On Mon, 2005-08-29 at 15:02 +0530, Harshal wrote:
#!/bin/bash mount -t vfat /some/usb_devfs/device /mnt/usb cd /mnt/usb
But somehow the 'cd' command behaves very strangely. if after cd /mnt/usb i put 'pwd' it shows '/mnt/usb' but, instead of 'pwd' if i put 'ls' it shows the listing of dir from which the script is executed. very strange.
$ cat bin/test.sh #!/bin/bash cd /mnt/sda; ls -a
I tested your script (a bit modified) and don't see the behaviour you describe. I executed the script from my $HOME which has many dirs and files.
ls -a shows . and .. (since /mnt/sda is empty) and pwd (replacing ls -a) shows /mnt/sda.