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
Which virtualization is used on your Enterprise?
- We don't use virtulization (90%, 9 Votes)
- VM Ware (10%, 1 Votes)
- Virtual Box (0%, 0 Votes)
- Parallels (0%, 0 Votes)
- coLinux (0%, 0 Votes)
- Xen (0%, 0 Votes)
- OpenVZ (0%, 0 Votes)
- Something else (0%, 0 Votes)
Total Voters: 10
Loading ...
Most popular search terms:
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
|


















