I have the following script:
#!/bin/bash
STUB=`pwd | awk -F '/' '{print "/" $2 "/" $3 "/"}'`
printf "arguments are $@\n"
if [ $STUB = "/mnt/nas/" ]; then
/usr/bin/ad ls $@ 1>&1
else
/bin/ls $@ 1>&1
fi
Somehow, however, whenever I run it the follwing text is automatically added as an argument even though I never typed it:
--color=auto
So I can run the following command:
ls
and it will always print
arguments are --color=auto
Even though I never typed that in.
This extra argument is messing up my script because /usr/bin/ad cannot parse it. Any ideas what I am doing wrong?
Thanks
Let me guess: the script is called
lsand you’ve definedlsas an alias forls --color=autoin~/.bashrcor elsewhere.