![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| extract field of characters after a specific pattern - using UNIX shell script | jansat | HP-UX | 2 | 05-28-2008 12:08 AM |
| need to extract field of characters in a line | jansat | Shell Programming and Scripting | 3 | 05-22-2008 09:44 AM |
| How to extract elements in a field using a number | ahjiefreak | Shell Programming and Scripting | 17 | 12-13-2007 04:13 AM |
| Extract Part of string from 3rd field $3 using AWK | stakuri | Shell Programming and Scripting | 4 | 10-10-2007 12:28 PM |
| Trying to extract a field from /etc/passwd file.. | xBuRnTx | UNIX for Dummies Questions & Answers | 2 | 10-05-2005 02:45 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to extract field from variable more efective
Hi,
I know that simple way to do this is var=`echo $line | awk '{print $5}'` But maybe there is shorter way to do this ? Also maybe there is some way to assign all fileds from line separated by lets say ":" to some variables instead of var1=`echo $line | awk '{print $1}'` var2=`echo $line | awk '{print $2}'` ..... Peter Last edited by pp56825; 01-19-2008 at 05:47 AM.. |
|
||||
|
What if the fileds in line are separated by : or ~ ?
found that i can export IFS=":". Ghostdog thanks for this set trick. Last edited by pp56825; 01-19-2008 at 06:22 AM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|