command " cd .. " not working in bash script?
Hi dear linux users.
i wonder why the cd ./.. or cd ./../ or cd .. command does not work, when used in bash script. But it works fine, when used on the command line. can i anybody tell me, why is it so? sorry if my question is silly. With Regards, kilam |
EDIT: Mis-Read your question.
|
What do you mean "does not work?". What happens? Is there an error?
Can you make the script output pwd before and after tring to cd? Cheers, Evo2. |
Quote:
my script(fc_mov_2.sh) is:---- #!/bin/bash cd ./../ #----end--------- when i run it, i get:--- hg@hg:~/Desktop/is64/trial> ./fc_mov_2.sh hg@hg:~/Desktop/is64/trial> pwd /home/hg/Desktop/is64/trial No error is shown. i wonder, what is happening? regards, kilam |
The script is a separate process. To illustrate (as I suggeted in my first post), use the following script:
Code:
#!/bin/bash Code:
. fc_mov_2.sh Evo2. |
Quote:
|
Quote:
Cheers, Evo2. |
Quote:
|
All times are GMT -5. The time now is 02:04 AM. |