Skip to content

Instantly share code, notes, and snippets.

@kunpengku
Created June 17, 2014 14:30
Show Gist options
  • Select an option

  • Save kunpengku/2c76790cd8b7316765ef to your computer and use it in GitHub Desktop.

Select an option

Save kunpengku/2c76790cd8b7316765ef to your computer and use it in GitHub Desktop.
将一个命令的输出赋值给一个变量的两种方式
a=`ls -l`
echo $a
echo
echo "$a"
a=$(ls -l)
echo $a
echo
echo "$a"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment