|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
|
|
#1
|
|||
|
|||
|
Problems with awk/sed
Hi There,
Maybe someone could help me with this: # cat file | awk ' /26/ {print $2}' 127.0.0.1/26 Q: Hot do i filter out the subnet part= /26 so the result is: 127.0.0.1 Thanks in advance ![]() |
|
#2
|
|||
|
|||
|
many ways
![]() awk: - sorry, i donīt know awk ![]() sed: # cat file | sed s/\/26// cut: # cat file | cut -d '/' -f 1 bash (from my experience works only inside a script, not on the command line or at least you need a lot of escapes then...): FILE=`cat file` FILE=${FILE##/26} (test also with only one # and with one % and with %%, i always mix them up and i am too lazy too look it up right now )
__________________
-- Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more. |
|
#3
|
|||
|
|||
|
works just fine!.. Thanks a'lot
![]() |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Linux Help > Problems with awk/sed |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|