problem with directory commands


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting problem with directory commands
# 1  
Old 01-23-2006
problem with directory commands

Hello...

I am having a slight problem when I run the basic directory command from a shell script...

i used the foll code::

[rasadm@telcellinux TEJ]$ cat a
pwd
date
cd ..

all the command of the script except the " cd .. " command are working...I also tried cd <dir_path> through diff means...including giving the absolute path...yet those two commands are not working from the script..


they are working on the command prompt,by the way..

can anyone please hint what could be the problem?


thanks....
# 2  
Old 01-23-2006
okay got the thing

well i got the solution....the script does change the directory but after the script ends,it returns to the present working dir from where the script was called ...

thanks ...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

UNIX commands to display the biggest file by size in a directory

Hello guys, Please i need to know the biggest files in my directory let's say$ >du -h | egrep 'M|G|G' 195M ./TMP 3.6M ./TP_DEC2012 146G . But here the result it's giving me the biggest directory in the path. Actually i want to know the biggest file in 146G . Can anyone... (6 Replies)
Discussion started by: gillesi
6 Replies

2. Shell Programming and Scripting

Problem running db2 commands in awk

Hi , I am trying to use the below in awk but failed, any one assist please, awk '{ print $0; if ( $0 ~ /LOADTMP1/ ) { print $4; Table_name=system($( db2 -x "SELECT TRIM(TD.BSCHEMA) || '.' || TRIM(TD.BNAME) AS TABLE_NAME FROM SYSCAT.TABDEP TD WHERE TD.BTYPE='T' AND... (2 Replies)
Discussion started by: Nandy
2 Replies

3. Shell Programming and Scripting

Strange problem with shell script commands

i have a very strange problem.....i gave the following command on the terminal sed '15 w temp' f1 -n | temp1=$(awk '{printf $3}' temp) | sed '/'$temp1'/s/1.330000/1.232032/' f1 > f10 where f1, temp and f10 are filenames. This works sometimes and the same command doesn't work sometimes.... (2 Replies)
Discussion started by: Agastya
2 Replies

4. Solaris

Problem to understand METADEVICE and related commands

Hi everyone, I'm new with solaris administration. I have just discovered the notion of METADEVICE and I really don't understand it. Can any one please explain it to me or give me useful link ? I also want to know more about these commandes: metainit metadb metaattach Thank you ... (1 Reply)
Discussion started by: adilyos
1 Replies

5. Shell Programming and Scripting

Ive got a problem with menu sub commands

Ive got a problem fron a menu script where: If i choose option 1 it will run a command for instance option 1 will run another script that will grep for a certain process name also using the If command. IE if chicken process is present echo cluck cluck, but if no chicken then echo no eggs... (4 Replies)
Discussion started by: wmccull
4 Replies

6. UNIX for Dummies Questions & Answers

A problem with a few UNIX commands

Hi guys , I'm new in UNIX and Linux ,and would appreciate your help (very) with the following questions . 1. how can I display all the files in the /home subdirectory tree usnig find and file . I'm supposed to do this in TWO different ways 2.using grep ,I need to isolate the line int... (2 Replies)
Discussion started by: cordel
2 Replies

7. Shell Programming and Scripting

Problem while execution of second set of commands

Hi, I have a shell script with code . perf.env cd $QRY_DIR for SHELL_FILE in sql1 do export SNAME=$SHELL_FILE ${SCRIPT_DIR}/perf_qry.sh ${SPOOL_DIR} ${DB_ENVNAME} ${NAME} & RC=$(expr ${RC:-0} + $? ) sleep 60 if then echo sysdate>test1 echo query1.txt>>test1 grep -i... (6 Replies)
Discussion started by: ran16
6 Replies

8. Shell Programming and Scripting

Problem while execution of second set of commands

Hi, I have a shell script with code . perf.env cd $QRY_DIR for SHELL_FILE in sql1 do export SNAME=$SHELL_FILE ${SCRIPT_DIR}/perf_qry.sh ${SPOOL_DIR} ${DB_ENVNAME} ${NAME} & RC=$(expr ${RC:-0} + $? ) sleep 60 if then echo sysdate>test1 echo query1.txt>>test1 grep -i... (0 Replies)
Discussion started by: ran16
0 Replies

9. Shell Programming and Scripting

Directory inside directory problem

hii, I have to create a directory under the same directory with the date +%a extension like this BackupLocation=$BackupLocation/$BackupLocation$(date +%w) but the problem is --- if backuplocation is abc/dfg then accroding to the above statement it would be abc/dfg/abc/dfg5 but i... (6 Replies)
Discussion started by: namishtiwari
6 Replies

10. UNIX for Advanced & Expert Users

use two unix commands to solve the following problem

Hi, all, The following commands could compute the 10 most frequent bigrams from a input sequence which is in a file infile. I would like to know whether there is somebody who can use only two unix commands to do the same work. -------------------- tr " " "\012*" <infile >out1 tail +2... (3 Replies)
Discussion started by: vicky20000
3 Replies
Login or Register to Ask a Question