|
Programming C, bash, Python, Perl, PHP, Java, you name it. |
|
Thread Tools | Display Modes |
|
|||
How to remove a word and everything after?
Hi guys,
Here's what I'm trying to do. Let's say I have the following line: 43.96.199.87 Bcast:43.96.199.255 Mask:255.255.255.0 How could I remove the word Bcast and anything after that word so that the line would look like this: 43.96.199.87 Please let me know of way that I can achieve this. P.S. I really appreciate the help you guys have given me. |
|
||||
Code:
# echo "43.96.199.87 Bcast:43.96.199.255 Mask:255.255.255.0" | awk '{print $1}'
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
|
|||
Thank you very much guys!
I was able to do exactly what I needed your help! |
|
|||
Another example below as well
Code:
echo 43.96.199.87 Bcast:43.96.199.255 Mask:255.255.255.0 | cut -w -f 1
__________________
www.tacoshack.xyz |
|
|||
Was not aware that '-w' was limited to FreeBSD... appreciate the info.
__________________
www.tacoshack.xyz |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to remove Gnome and X | Malakim | Solaris | 2 | 12th April 2009 12:10 PM |
NIC with internal cable; how to remove? | TerryP | Off-Topic | 9 | 14th July 2008 06:33 AM |
Alternative Word Processing and Spreadsheet Applications | enpey | FreeBSD Ports and Packages | 13 | 7th June 2008 09:27 AM |
Remove/disable a former system user | anomie | Guides | 6 | 19th May 2008 12:37 AM |
remove kde and kde dependent apps | ccc | FreeBSD Installation and Upgrading | 2 | 12th May 2008 02:11 PM |