Comments on: How To Assign Output of a Linux Command to a Variable https://www.tecmint.com/assign-linux-command-output-to-variable/ Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks. Thu, 13 Jul 2023 19:25:41 +0000 hourly 1 By: Timi https://www.tecmint.com/assign-linux-command-output-to-variable/comment-page-1/#comment-1755123 Fri, 01 Apr 2022 10:08:00 +0000 http://www.tecmint.com/?p=24222#comment-1755123 In reply to Timi.

The command module list python writes to the command line:

Currently Loaded Modules Matching: python/3.7.4

]]>
By: Timi https://www.tecmint.com/assign-linux-command-output-to-variable/comment-page-1/#comment-1755122 Fri, 01 Apr 2022 10:05:59 +0000 http://www.tecmint.com/?p=24222#comment-1755122 In my case it does not work for:

currentModule=$(module list python)
echo "Current loaded module is $currentModule"
]]>
By: Aaron Kili https://www.tecmint.com/assign-linux-command-output-to-variable/comment-page-1/#comment-1330387 Mon, 27 Apr 2020 06:27:37 +0000 http://www.tecmint.com/?p=24222#comment-1330387 In reply to Depressing Engineer.

@Depressing

True, it was a typo during publishing. We will modify the article as soon as possible. Thanks for the feedback.

]]>
By: Depressing Engineer https://www.tecmint.com/assign-linux-command-output-to-variable/comment-page-1/#comment-1329708 Sat, 25 Apr 2020 18:16:15 +0000 http://www.tecmint.com/?p=24222#comment-1329708 In reply to Aaron Kili.

From the link Above “The backtick is also easily confused with a single quote.”

This happened in this article for the first figure.

...
OR
variable_name='command'
variable_name='command [option ...] arg1 arg2 ...'
...
]]>
By: Aaron Kili https://www.tecmint.com/assign-linux-command-output-to-variable/comment-page-1/#comment-863535 Mon, 30 Jan 2017 09:19:18 +0000 http://www.tecmint.com/?p=24222#comment-863535 In reply to Michael Schwager.

@Micheal

Yap, how did i forget to mention this, it’s so helpful while writing scripts. Thanks for the reminder.

]]>