|
Prev: how to get the script name when sourcing it?
Next: Brand Watches Movado Women's Esperanza Watch 605128 Discount, Swiss, Fake
From: troyzeng on 24 Apr 2008 21:35 How to explain the following? $ pwd /home/user1 $ which ./a.sh ../a.sh $ which ./a.sh | grep '.*' /home/user1/a.sh $ which ./a.sh | tee /dev/null /home/user1/a.sh It gives the full path as long as it's piped.
From: mop2 on 24 Apr 2008 21:55 Please, redo and confirm: $ which ./a.sh ../a.sh If yes, and this: $ which ./a.sh | cat troyzeng wrote: > How to explain the following? > $ pwd > /home/user1 > $ which ./a.sh > ./a.sh > $ which ./a.sh | grep '.*' > /home/user1/a.sh > $ which ./a.sh | tee /dev/null > /home/user1/a.sh > > It gives the full path as long as it's piped.
From: troyzeng on 24 Apr 2008 22:53 On 25 Apr, 11:55, mop2 <mop2bky4mz5tyjwa8ersp7hrg5u...(a)gmail.com> wrote: > Please, redo and confirm: > $ which ./a.sh > ./a.sh > > If yes, and this: > $ which ./a.sh | cat > > troyzeng wrote: > > How to explain the following? > > $ pwd > > /home/user1 > > $ which ./a.sh > > ./a.sh > > $ which ./a.sh | grep '.*' > > /home/user1/a.sh > > $ which ./a.sh | tee /dev/null > > /home/user1/a.sh > > > It gives the full path as long as it's piped. $ which ./a.sh | cat /home/user1/a.sh It also returns the full path.
From: Stephane CHAZELAS on 25 Apr 2008 02:31
2008-04-24, 18:35(-07), troyzeng: > How to explain the following? > $ pwd > /home/user1 > $ which ./a.sh > ./a.sh [...] "which" is a non-standard command. You could get anything, there exist a lot of implementations behaving differently. Try "command -v" instead. -- St�phane |