Command output to variable in bash

From Attie's Wiki
Revision as of 23:48, 17 March 2010 by 192.168.0.1 (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Ever wanted to capture the output of a command into a variable in bash? It's simple!

variable=$(command)

date=$(date)
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox