一、shell中的變量聲明
#!/bin/bash
num=2
#declare num=2
#let num=2
echo "num = ${num}"
二稚疹、shell中命令運(yùn)行結(jié)果賦值給某個變量
#!/bin/bash
#path=$(pwd)
path=`pwd`
echo current path: $path
#!/bin/bash
num=2
#declare num=2
#let num=2
echo "num = ${num}"
#!/bin/bash
#path=$(pwd)
path=`pwd`
echo current path: $path