On Sun, Jan 18, 2004 at 05:44:25PM -0600, Kenton Brede ([EMAIL PROTECTED]) wrote:
I've been searching the archives and google for an answer. I suspect it
can't be done but thought I'd ask.
What I'm trying to do is create a tool such as "cdargs", in perl, to simplify moving between directories on the command line.
The problem I'm having of course is actually changing the shell's
working directory from the Perl script. Is there anyway I can do this with Perl?
Thanks all for the input. What I've done to work around this is create a bash function and then source it from the command line. I know this has nothing to do with Perl but to close this thread out for the archives in case someone has the same question -
A very simplified version of what I'm doing:
In mycd.sh
mycd() { cd $1; }
$ . mycd.sh
$ mycd /directory
Kent
To flesh out your script you may want to have a glance at some of the examples of re-implementing cd using shell scripts offered in O'Reilly's Learning the Bash Shell book, so that you lose less of the functionality that the normal built-in 'cd' offers....
http://www.oreilly.com/catalog/bash2/
http://danconia.org
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>