couldn't find and understand why I'm getting an error depending on the order of execution in my bash script.
I'm getting 2 arguments:
- path to a directory.
- a string.
PATH="$1"
WORD="$2"
FILES="$(ls ./testRoot/*.c)"
outputs that "ls: command not found".
but,
FILES="$(ls ./testRoot/*.c)"
PATH="$1"
WORD="$2"
works just fine.
I can't figure out why this is happening and wants to understand, and how can I handle this.
p.s the same goes for the 'grep' command, but I'm guessing it's the same reason.
Thanks.