dcsimg
Linux Today: Linux News On Internet Time.




More on LinuxToday


Bash Assign Output of Shell Command To Variable

Nov 27, 2019, 11:06 (0 Talkback[s])
(Other stories by Anonymous)

WEBINAR:
On-Demand

Desktop-as-a-Service Designed for Any Cloud ? Nutanix Frame


How do I assign the output of a shell command to a shell variable under Linux and Unix like operating system? For example, I want to store the date command output to a variable called $now. How do you do that? How can I set a variable to the output of a command in Bash?

Complete Story