[Scottish] storing current directory
Hi there, I am modifying a script, and I need to be able to store the current directory, so I can come back to it. I tried export AMB_TMP=pwd but it doesnt work, AMB_TMP becomes 'pwd' rather than the current directory. How would I do this? Thanks Allan ___ Scottish mailing list [EMAIL PROTECTED] http://mailman.lug.org.uk/mailman/listinfo/scottish
RE: [Scottish] storing current directory
export AMB_TMP=pwd welcome to backticks... #!/bin/sh AMB_TMP=`pwd` cd /some/New/Dir cd $AMB_TMP ___ Scottish mailing list [EMAIL PROTECTED] http://mailman.lug.org.uk/mailman/listinfo/scottish
Re: [Scottish] storing current directory
Allan, export AMB_TMP=`pwd` Note the use of back ticks, not normal quotes. Thanks, Allan Allan Bruce wrote: Hi there, I am modifying a script, and I need to be able to store the current directory, so I can come back to it. I tried export AMB_TMP=pwd but it doesnt work, AMB_TMP becomes 'pwd' rather than the current directory. How would I do this? Thanks Allan ___ Scottish mailing list [EMAIL PROTECTED] http://mailman.lug.org.uk/mailman/listinfo/scottish ___ Scottish mailing list [EMAIL PROTECTED] http://mailman.lug.org.uk/mailman/listinfo/scottish
Re: [Scottish] storing current directory
export AMB_TMP=`pwd` Ben Allan Bruce [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent by:cc: [EMAIL PROTECTED]Subject: [Scottish] storing current directory .lug.org.uk 22-01-04 15:36 Please respond to SLUG-list Hi there, I am modifying a script, and I need to be able to store the current directory, so I can come back to it. I tried export AMB_TMP=pwd but it doesnt work, AMB_TMP becomes 'pwd' rather than the current directory. How would I do this? Thanks Allan ___ Scottish mailing list [EMAIL PROTECTED] http://mailman.lug.org.uk/mailman/listinfo/scottish ___ Scottish mailing list [EMAIL PROTECTED] http://mailman.lug.org.uk/mailman/listinfo/scottish
Re: [Scottish] storing current directory
* Allan Bruce ([EMAIL PROTECTED]) wrote: Hi there, I am modifying a script, and I need to be able to store the current directory, so I can come back to it. I tried export AMB_TMP=pwd export AMP_TMP=`pwd` iain -- If sharing a thing in no way diminishes it, it is not rightly owned if it is not shared. -- St. Augustine #rm -rf / http://www.geeksoc.org/ ___ Scottish mailing list [EMAIL PROTECTED] http://mailman.lug.org.uk/mailman/listinfo/scottish
Re: [Scottish] storing current directory
Yay! First post :o) Ben Thorp Ben Thorp/UK/Contr/[EMAIL PROTECTED]To: SLUG-list [EMAIL PROTECTED] Sent by:cc: [EMAIL PROTECTED]Subject: Re: [Scottish] storing current directory .lug.org.uk 22-01-04 15:37 Please respond to SLUG-list export AMB_TMP=`pwd` Ben Allan Bruce [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent by:cc: [EMAIL PROTECTED]Subject: [Scottish] storing current directory .lug.org.uk 22-01-04 15:36 Please respond to SLUG-list Hi there, I am modifying a script, and I need to be able to store the current directory, so I can come back to it. I tried export AMB_TMP=pwd but it doesnt work, AMB_TMP becomes 'pwd' rather than the current directory. How would I do this? Thanks Allan ___ Scottish mailing list [EMAIL PROTECTED] http://mailman.lug.org.uk/mailman/listinfo/scottish ___ Scottish mailing list [EMAIL PROTECTED] http://mailman.lug.org.uk/mailman/listinfo/scottish ___ Scottish mailing list [EMAIL PROTECTED] http://mailman.lug.org.uk/mailman/listinfo/scottish
Re: [Scottish] storing current directory
* Mark McRitchie ([EMAIL PROTECTED]) wrote: -Original Message- From: Elwell, AD (Andrew) [mailto:[EMAIL PROTECTED] export AMB_TMP=pwd welcome to backticks... Or... You can use AMB_TMP=$(pwd) Using the $(cmd) structure in bash means you can easily nest commands which backticks make difficult/impossible. $ echo `file \`find tmp\`|grep text|cut -f1 -d:` tmp/beneath_a_steel_sky.txt iain -- If sharing a thing in no way diminishes it, it is not rightly owned if it is not shared. -- St. Augustine #rm -rf / http://www.geeksoc.org/ ___ Scottish mailing list [EMAIL PROTECTED] http://mailman.lug.org.uk/mailman/listinfo/scottish