![]() |
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 |
| storing result of a command in variable | eltinator | Shell Programming and Scripting | 1 | 04-17-2008 08:09 PM |
| Storing a variable? | hoover90 | Shell Programming and Scripting | 4 | 01-26-2008 09:39 PM |
| Storing the output into a variable | ravi raj kumar | UNIX for Dummies Questions & Answers | 7 | 12-11-2006 09:14 AM |
| storing output of awk in variable | mab_arif16 | Shell Programming and Scripting | 3 | 05-07-2006 06:15 PM |
| Storing values in variable | matrixmadhan | Shell Programming and Scripting | 1 | 04-01-2005 01:56 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
storing a command in a variable
how would i go about storing this command in a variable
echo "$LINE" | awk -F"|" '{print $1"|"$2"|"$3"}' i have tried FOO = ${command up there} but receive the error FOO: not found aswell as a couple of other attempt but no luck |
|
|||||
|
Hi.
There is a difference between storing the text of a command and storing the results of a command in a variable; vino provided the latter. In any case, you need to omit the spaces around the "=" sign. If you have a space, then the Bourne family shells will assume you wish to run a command, such as FOO. That usually produces an error message, as you have seen. It is good that you provided the evidence for your problem. However, data and commands are far easier to read when you place them inside CODE blocks as vino did. To do that, select the text and press the # just above the editing window. Best wishes ... cheers, drl |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|