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),

Re: odd search order looking for perl?

2001-02-17 Thread Francesco Potorti`
> 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 with bash's bilt-in test and the stand-alone test.

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 in

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 Fri, 16 Feb 2001, Edward J. Sabol wrote: > There's a problem with this if you have a directory named "perl" > inside a directory in your path. I'm not all that familiar with > Bourne shell syntax, so the following may not be syntactically > correct, but you need to do something like this: > >

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/pe

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-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

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.

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-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; do

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 wer

Re: odd search order looking for perl?

2001-01-18 Thread Chris Green
[EMAIL PROTECTED] (Kai Großjohann) 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" wh

Re: odd search order looking for perl?

2001-01-18 Thread Kai Großjohann
On 18 Jan 2001, Chris Green wrote: > [EMAIL PROTECTED] (Kai Großjohann) 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 r

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

Re: odd search order looking for perl?

2001-01-18 Thread Bruce Ingalls
Kai Großjohann wrote: > How am I supposed to check the value of $SHELL? Also, csh-like shells > might have $shell rather than $SHELL... > > As you can see, even the `if' command is quite different. Uh yeah. dead end. >> Does it make sense to do a which()-like command, and use that >> version

Re: odd search order looking for perl?

2001-01-18 Thread Chris Green
[EMAIL PROTECTED] (Kai Großjohann) 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 Wed, 17 Jan 2001, Bruce Ingalls wrote: > Kai Großjohann 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 lo

Re: odd search order looking for perl?

2001-01-18 Thread Kai Großjohann
On 17 Jan 2001, Chris Green wrote: > Would it be possible to have ( or perhaps there already is ) a list > of commands that get executed on the remote host to ``prep'' sh for > tramp? The main one that comes to mind for me is unalias ls instead > of getting ls --color=auto commented out. Of cou

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 comman

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 tha

Re: odd search order looking for perl?

2001-01-17 Thread Bruce Ingalls
Kai Großjohann 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 wh

Re: odd search order looking for perl?

2001-01-17 Thread Chris Green
[EMAIL PROTECTED] (Kai Großjohann) 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 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 wher

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 $? tramp