Here is the content of my bash script:
#!/bin/bash
set INPFILE=$argv[1]
echo "Your input file is "
echo $INPFILE
and I execute it as:
$ ./script.sh inputfile.in
For some reason, bash doesn't accept the argval[1]
. I do not receive an error either.
BTW, the output is:
Your input file is
答案 0 :(得分:2)
Change set INPFILE=$argv[1]
to:
INPFILE="$1"
$1, $2, $3 .... etc are the positional parameters passed to the script/function.