Librenix  
(Show all Scripting articles . . .
)  
Headlines | Linux | Apps | Coding | BSD | Admin | News
Information for Linux System Administration 

Command substitution in Bash scripting

Up
vote
Down

Command substitution is a useful way to take the output of one command and use it as an argument in another command.
The first way is the more modern way, and is really the only way that you want to use. You surround the command that you want to substitute with parentheses, and then precede it with a dollar-sign. Here, we’re using echo to show the output of date.

echo $(date)
 read more | score:8207 | -aweber, February 5, 2011
More Programming articles...

Buy Digital Art on Acrylic

coding headlines

Book Review: Invent Your Own Computer Games with Python, 2nd Ed.

Perl: Delicious DBIx::Class::Candy

DeviceAnywhere: testing mobile apps

Unix signals list

Sysadmin Shell Scripting

13 Regex Features

 

Firefox sidebar

Site map

Site info

News feed

Features

Login
(to post)

Search

 
Articles are owned by their authors.   © 2000-2012 Ray Yeargin