linux - Bash script process substitution Syntax error: "(" unexpected -
i want run script:
#!/bin/bash echo <(true) and "syntax error: "(" unexpected" . found similar situations still can't solve this. i'm beginner @ shell scripting , understand:
- the shebang use correct , chooses bash shell , process substitution syntax should work
- i try same command line , works. checked
echo $0, gives me "bash" , what's difference running command in command line , script invokes same shell?
maybe it's simple, couldn't find explanation or solution.
you should run script bash, i.e. either bash ./script.sh or making use of shebang ./script.sh after setting executable. running sh ./script.sh error, commented cyrus.
see also: role of shebang @ unix.se
Comments
Post a Comment