![]() |
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 |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Capturing a number at the end of line and store it as variable | amuthiga | Shell Programming and Scripting | 6 | 11-26-2008 07:40 AM |
| Using grep to extract line number | mskarica | Shell Programming and Scripting | 8 | 06-26-2008 02:47 AM |
| how to store grep command in a Variable | madhusmita | Shell Programming and Scripting | 4 | 06-18-2008 07:58 AM |
| Grep results to store in a shell variable | jojan | Shell Programming and Scripting | 3 | 07-26-2007 12:44 PM |
| What is the Maximum number of characters that i can store in a variable? | pcshan | UNIX for Advanced & Expert Users | 9 | 08-11-2004 05:25 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Using GREP/AWK to extract a number and store it as a variable
Hello,
I have a question regarding the awk command. Here is the line I need to grep: 1 F= -.13250138E+03 E0= -.13249556E+03 d E =-.174650E-01 mag= 35.2157 Instead of displaying the number in red I would like to store it as a variable such as X. Is there a way to do this? Thanks for any help. modey3 |
|
||||
|
Never mind, I figured it out...
eval $(echo '1 F= -.13250138E+03 E0= blah ' | awk '{print "X=" $3}') |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|