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:

  1. the shebang use correct , chooses bash shell , process substitution syntax should work
  2. 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

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -