Vidyadutt S wrote:

#!/bin/bash
mount -t vfat /some/usb_devfs/device /mnt/usb
cd /mnt/usb

I tried this script in the following manner:
*$cat test.sh*
*#!/usr/bin/bash*
*cd /opt*
*pwd*
*ls*
When the script is executed, it gives the pwd as /opt and the ls lists the contents of /opt. But when I execute pwd from shell, it gives the directory from where I executed the script.
adding to that, on can use source command to run script in same shell



Reason: The script is executed in a new shell. When it finishes the execution, the shell is killed automatically.
Vidyadutt.
HTH
Supreet

--
http://mm.ilug-bom.org.in/mailman/listinfo/linuxers

Reply via email to