I want to save ${1}
argument passed to my script (${1}
is a file path) into a string variable within the same shell script, and then echo
the path using echo variable
and not echo ${1}
.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Simply try doing this :
myvar="$1"
echo "$myvar"
回答2:
Saving argument to variable 'var' ::
local var="${1}"
Echo the variable ::
echo "${var}"