14
rated 0 times
[
14]
[
0]
/ answers: 1 / hits: 22897
/ 2 Years ago, sun, october 2, 2022, 3:21:33
I tried the following small simple script:
#!/bin/bash
$1="bar"
echo $1
But when I run ./script foo
I get error and the value is not changed:
/home/mika/script: line 2: foo=bar: command not found
foo
I know $1 is the first argument you pass to your script. But even like this I want to change its value.
More From » command-line