The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Assigning output of command to a variable
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
Assigning output of command to a variable
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
3
(
permalink
)
06-27-2006
LivinFree
Goober Extraordinaire
Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
Modern Bourne shell variants support $(command) notation as well, which allows nesting and, in my opinion, is easier on the eyes.
Some, such as bash, allow you to do fun stuff such as this=$(<file.txt) to grab the contents of file.txt in the variable "this".
LivinFree
View Public Profile
Find all posts by LivinFree
Find LivinFree's past nominations received
Find LivinFree's present nominations given