...and then Bennett Todd said...
% 2000-07-17-10:27:31 David T-G:
% > % > % #!/bin/sh
% > % > % test -n "SSH_TTY" && exec vim ${1+"$@"}
% > % > % test -n "$DISPLAY" && exec gvim ${1+"$@"}
% > % > % exec vim ${1+"$@"}
% >
% > If SSH_TTY is unset and DISPLAY is set, you'll not run vim (line
% > 1) [...]
%
% Agreed.
%
% > and run gvim (line 2) [...]
%
% Agreed.
%
% > and run vim (line 3).
%
% Sorry? How will you ever get to line 3? When you run gvim on line 2,
% the invocation is exec gvim ${1+"$@"}, and exec doesn't come back.
Oh. *duh* Right.
Boy do I feel silly now. Sorry 'bout that :-)
%
% > I whipped out the chained oneliner primarily to avoid succeeding
% > a test up top and then falling through to the default case and
% > running vim again.
%
% Exec achieves the same end, I believe.
Yes, I'm sure that's right. I just missed the exec, and I never use it
so it still didn't stand out.
%
% -Bennett
:-D
--
David T-G * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.bigfoot.com/~davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
The "new millennium" starts at the beginning of 2001. There was no year 0.
Note: If bigfoot.com gives you fits, try sector13.org in its place. *sigh*
PGP signature