Modifying a parameter pass to a script (Bash)

前端 未结 3 533
醉酒成梦
醉酒成梦 2021-01-12 13:41

I have been looking on Google for quite a while now and can\'t find anything that is matching what I need/want to do.

My objective is to write a script that takes tw

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-12 14:42

    First copy your parameters to local variables:

    Arg1=$1
    

    Then, where you are assigning leave off the $ on the variable name to the left of the =

    You can't have a $ on the left hand side of an assignment. If you do, it's interpreting the contents of $1 as a command to run

    hope this helps

提交回复
热议问题