Re: odd search order looking for perl?

2001-02-18 Thread Kai Großjohann
On Sun, 18 Feb 2001, Francesco Potorti` wrote: Yes. The correct way is: -f $dir/perl -a -x $dir/perl Now I'm confused. What if /usr/bin/perl is a symlink to /usr/bin/perl5.005 or something? It works with a file (or simlink) and with a directory (or simlink), both

Re: odd search order looking for perl?

2001-02-17 Thread Kai Großjohann
On Sat, 17 Feb 2001, Francesco Potorti` wrote: Yes. The correct way is: -f $dir/perl -a -x $dir/perl Now I'm confused. What if /usr/bin/perl is a symlink to /usr/bin/perl5.005 or something? Is it better to say "-f $d/perl -a -x $d/perl", or "-x $d/perl -a \! -d $d/perl"? kai -- Be

Re: odd search order looking for perl?

2001-02-16 Thread Edward J. Sabol
I was afraid that this which-like command might be known by various names on various systems, and the output might vary. I tried this, and I think it should work on any bourne shell: echo $PATH | tr : \\n | while read dir; do if [ -x $dir/perl ]; then echo $dir/perl; break; fi; done

Re: odd search order looking for perl?

2001-02-16 Thread Francesco Potorti`
do if [ -x $dir/perl ! -d $dir/perl ] instead of just do if [ -x $dir/perl ] Yes. The correct way is: -f $dir/perl -a -x $dir/perl

Re: odd search order looking for perl?

2001-02-16 Thread Kai Großjohann
On Wed, 24 Jan 2001, Francesco Potorti` wrote: I was afraid that this which-like command might be known by various names on various systems, and the output might vary. I tried this, and I think it should work on any bourne shell: echo $PATH | tr : \\n | while read dir; do if

Re: odd search order looking for perl?

2001-02-16 Thread Francesco Potorti`
Any other functions which should be optimized in this way? Maybe. Proposals?

Re: odd search order looking for perl?

2001-01-24 Thread Pete Forman
Francesco Potorti` writes: I was afraid that this which-like command might be known by various names on various systems, and the output might vary. I tried this, and I think it should work on any bourne shell: Yes but not for any tr. Try this change echo $PATH | tr : \\n |

Re: odd search order looking for perl?

2001-01-24 Thread Daniel Pittman
Pete Forman [EMAIL PROTECTED] writes: Francesco Potorti` writes: I was afraid that this which-like command might be known by various names on various systems, and the output might vary. I tried this, and I think it should work on any bourne shell: Yes but not for any tr. Try this change

Re: odd search order looking for perl?

2001-01-23 Thread Francesco Potorti`
I was afraid that this which-like command might be known by various names on various systems, and the output might vary. I tried this, and I think it should work on any bourne shell: echo $PATH | tr : \\n | while read dir; do if [ -x $dir/perl ]; then echo $dir/perl; break; fi;

Re: odd search order looking for perl?

2001-01-19 Thread Mark A. Hershberger
Kai, # Bourne shell if [ "$SHELL" = "/bin/sh" ] ; then echo bourne, bourne fi # Csh if ( "$SHELL" == "/bin/csh" ) then echo c, c endif As you can see, even the `if' command is quite different. Perhaps you were aiming at something entirely different, but if you were just

Re: odd search order looking for perl?

2001-01-18 Thread Chris Green
[EMAIL PROTECTED] (Kai Grojohann) writes: I think people should init their shell like this: case "$TERM" in linux|xterm) alias ls=... ;; esac After all, printing color sequences on if $TERM=dumb does not make sense. I've done basically the same thing for

Re: odd search order looking for perl?

2001-01-18 Thread Kai Großjohann
On Thu, 18 Jan 2001, Bruce Ingalls wrote: I use which.el, myself, which is fast. However, I recall that there is some which()-like emacs function. Err. I need to do this on the remote host, not on the local host. And the point of Tramp is that I don't need Emacs on the remote host. And if I

Re: odd search order looking for perl?

2001-01-18 Thread Kai Großjohann
On 18 Jan 2001, Chris Green wrote: [EMAIL PROTECTED] (Kai Grojohann) writes: I was hoping to get a basic Bourne shell after "exec /bin/sh". Therefore, the aliases should be off after this. Are they? Yes they are. Good. According to the docs, bash called as sh isn't supposed to read

Re: odd search order looking for perl?

2001-01-18 Thread Chris Green
[EMAIL PROTECTED] (Kai Grojohann) writes: I confess that I've also got a strange prompt and I had to frob shell-prompt-pattern to recognize optional color escape sequences. Not pretty at all. Okay. There is a new version of Tramp now which locally sets the env var TERM to "dumb" when

odd search order looking for perl?

2001-01-17 Thread Skip Montanaro
I noticed this odd sequence of tests for perl in my tramp debug buffer: $ test -x /bin/perl5 ; echo tramp_exit_status $? tramp_exit_status 1 $ test -x /usr/bin/perl5 ; echo tramp_exit_status $? tramp_exit_status 1 $ test -x /usr/sbin/perl5 ; echo tramp_exit_status $?

Re: odd search order looking for perl?

2001-01-17 Thread Chris Green
[EMAIL PROTECTED] (Kai Grojohann) writes: then issuing this command is quite fragile already.) In the beginning, I assumed that every Unix host had a /bin/sh and that "exec /bin/sh" would be a good way to start a known shell from the beginning. Would it be possible to have ( or perhaps

Re: odd search order looking for perl?

2001-01-17 Thread Bruce Ingalls
Kai Grojohann wrote: The only reason that tramp-remote-sh exists is that "exec /bin/sh" is the very first command that's issued by Tramp, so that it at least knows how to set the prompt and stuff like this. Isn't $SHELL set at remote login? You can usually look at /etc/shells to see what

Re: odd search order looking for perl?

2001-01-17 Thread Bruce Ingalls
Perhaps certain commands should be setq()ed. You do not need to unalias ls, if you call \ls which invokes the original ls. I tested this command on solaris's /bin/sh, which is _not_ xpg4 compliant. It still works. ls --color=auto only works for gnu ls, and probably only gnu ls that is less

Re: odd search order looking for perl?

2001-01-17 Thread Chris Green
Bruce Ingalls [EMAIL PROTECTED] writes: Perhaps certain commands should be setq()ed. You do not need to unalias ls, if you call \ls Didn't know this factoid - thanks you've saved me from having to type /bin/ls everytime I mean it. which invokes the original ls. I tested this command on

Re: odd search order looking for perl?

2001-01-17 Thread Kai Großjohann
On Wed, 17 Jan 2001, Skip Montanaro wrote: Why is /usr/bin/perl checked last? Seems to me to be the most likely place to find it. Why not use something akin to tramp-sh-program to allow users to specify odd locations for perl? Tramp must check for perl5 first, since on those systems where