export PATH results in: bash ls No such file or directory

Hi,
I’d appreciate anyone shedding light on the following:

In bash I thought parentheses just controlled the order of execution/expansion.
The following works fine.


> su -
Password:
pm:~ # ls |head -n 1
.DCOPserver_mvlaptop_:0
pm:~ # export PATH=/tmp:$PATH
pm:~ # echo $PATH
/tmp:/sbin:/usr/sbin:/usr/local/sbin:/opt/kde3/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/NX/bin
pm:~ # ls |head -n 1
.DCOPserver_mvlaptop_:0
pm:~ # exit

So, given the echo outputs the same contents as above, is the following behavior a bug?


> su -
Password:
pm:~ # ls |head -n 1
.DCOPserver_mvlaptop_:0
pm:~ # export PATH=(/tmp:$PATH)
pm:~ # echo $PATH
/tmp:/sbin:/usr/sbin:/usr/local/sbin:/opt/kde3/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/NX/bin
pm:~ # ls |head -n 1
-bash: head: No such file or directory
-bash: ls: No such file or directory

That’s the wrong syntax. It should be just

export PATH="/tmp:$PATH"

The ()s have a meaning in bash, and not what you expect. Hint: arrays.