Quote:
Originally posted by pony85
Well thats also no use stickman.... The same thing happens when i execute the ls command as a ordinary user...
regards
Pony85
|
By running that command as a regular user you minimize the chances of corrupting commands. Also since is appear that you're not getting an error message, it appears that that your ls command is still intact.
The cd piped to ls is not a bug. It's working correctly, but it not doing what you think it should do. Try the following (# are comment lines):
# go to home directory
cd
# run odd pipe command
cd /bin | ls
# get current directory
pwd
# re-run odd pipe command with another directory
cd /tmp | ls
# get current directory
pwd
You should get the same results for both /bin and /tmp. Changing to a valid directory produces no output to send to the pipe. ls reads arguments not from a pipe. The ls is always on the current directory. The command (although pointless) is producing the correct ouput. Better alternatives are:
cd /bin && ls
ls /bin