Results 1 to 3 of 3
I want the output of command1 goes into variable A .
For instance, if command1 = echo -n "148" , I want put 148 into A .
I have done ...
- 11-03-2007 #1Just Joined!
- Join Date
- Jul 2007
- Location
- Italy
- Posts
- 11
Script: put the output of a command into a variable.
I want the output of command1 goes into variable A .
For instance, if command1 = echo -n "148" , I want put 148 into A .
I have done some tries, but these doesn't work:
TksCode:echo -n "148" > A echo -n "148" > A= echo -n "148" | A echo -n "148" | A= echo -n "148" | read A ....etc
- 11-03-2007 #2Linux Enthusiast
- Join Date
- Aug 2006
- Posts
- 631
To put the output of a command into a variable:
orCode:A=`command args`
To put a value into a variablele:Code:A=$(command args)
Go here for some tutorials:Code:A=148
http://www.tldp.org/LDP/Bash-Beginne...tml/index.html
http://tldp.org/LDP/abs/html/
Linux Shell Scripting Tutorial - A Beginner's handbook
Regards
- 11-03-2007 #3Just Joined!
- Join Date
- Jul 2007
- Location
- Italy
- Posts
- 11
Thank you for all.


Reply With Quote