![]() |
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 |
| Question on Initializing the Variable | chris1234 | UNIX for Dummies Questions & Answers | 1 | 04-14-2008 03:59 PM |
| Another variable question, I think | NycUnxer | UNIX for Dummies Questions & Answers | 2 | 02-28-2008 11:30 PM |
| Export command giving Variable Name vs the Value set for the Variable | ParNone | UNIX for Dummies Questions & Answers | 2 | 04-03-2006 11:43 AM |
| VAriable Question | rjsha1 | Shell Programming and Scripting | 4 | 02-07-2006 08:03 AM |
| variable initialize question | whatisthis | High Level Programming | 2 | 02-08-2005 05:21 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Question On Command in Variable
I have been working on a script that executes on a number of different operating systems. As a result I was trying to set a variable or perhaps variable array depending on the OS. I tried the following using eval and such but so far have not had any luck. Is there a way to do something like the following.
DF="df -h | sed -e :a -e '$!N;s/\n / /;ta' -e 'P;D' | /usr/xpg4/bin/grep -ivE "filesystem|$FSIGNORE" | awk '{ print $6" "$5}'" Later in the script do this: $DF | while read LINE; do ... I tried a host of different things, like putting eval into the variable and escaping the quotes but it just did not seem to work correctly. Any ideas, or am I better off writing the output of the command to a temp file and reading from the file? Thanks in advance. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|