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:7662 | -aweber, February 5, 2011
More Programming articles...

Buy Fine Art on Canvas Online

Selected articles

Apple DIY Repair

Linux dominates Windows

Apple to Intel move no threat to Linux

Mono-culture and the .NETwork effect

Hacker Haiku

The life cycle of a programmer

 

Firefox sidebar

Site map

Site info

News feed

Features

Login
(to post)

Search

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