exec shell command

by Ramya 2009-12-05 19:37:50

exec shell command:

To redirect the current working directory to another folder or directory "exec" command in used in shell scripting.
echo enter file name
read fname
exec<$fname


This will move to the given file name.
For eg,
[root@localhost htdocs]# sh test.sh
enter file name
test

This script will redirect to the test folder and performs the action given.Razz

But it wont move the given directory, it just redirect to the directory.

Tagged in:

986
like
0
dislike
0
mail
flag

You must LOGIN to add comments