Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将${1}传递给我的脚本的参数(${1}是一个文件路径)保存到同一个 shell 脚本中的一个字符串变量中,然后echo使用路径echo variable而不是echo ${1}.
${1}
echo
echo variable
echo ${1}
Simply try doing this :
myvar="$1" echo "$myvar"
将参数保存到变量“var”::
local var="${1}"
回显变量 ::
echo "${var}"