Set bash variable to contain the output of command or process. Store process stdoutBy neokrates, written on May 7, 2010 |
bash snippet |
- neokrates
- Email: uwarov@yahoo.com
- Website: http://www.thinkplexx.com
- Join date: 05-31-09
- Posts: 20
Rate it
Ad
Poll
Loading ...
Most popular search terms:
Stats
-
Since publication, this page was visited 521 time(s).
vat=$(my command)
Example: Store the output of which firefox and complain if no firefox installed.
1 2 3 4 5 | res=$(which firefox) if [ "" = "$res" ]; then echo "No firefox found" exit -1 fi |
Another way:
vat=`my command`
like:
res=`which firefox`
|
TAGS
|
|
SOCIAL
|


















