[unix-pc.general] Using ksh for command escapes from UA

ralph@rtech.rtech.com (Ralph Harnden) (10/30/88)

Ingore this article if you don't use the User Agent (UA) on your UNIXPC.  

When using "!command" to invoke commands from UA windows, it seems that UA
fork/exec's /usr/lib/ua/uasetx, passing the parameters "/bin/sh -c command".
Uasetx, in turn, seems to fork/exec the shell (first parameter) to invoke
the command.  And the shell, in turn, fork/exec's the command.  

UA ignores the $SHELL environment variable when invoking uasetx.  And 
uasetx ingores $SHELL.  If command is a ksh alias, you lose.

Am I missing something here?  Is there any way to coerce UA into using
ksh instead?

To circumvent this problem, I used bpe to zap the appropriate constant 
"/bin/sh" to "/bin/ks" in /usr/bin/ua, and I "ln /bin/ksh /bin/ks".
Works fine -- UA now uses ksh to invoke !commands, and alias' work.

I am running 3.5.1.4 (?), but the correct "/bin/sh" is just past the
message "You must be an expert to execute shell commands".  Probably
the same in 3.51.  

Anybody:  Is there an easier way?  If not, I hope this helps....

-- 
"People will do anything for a potato"

{amdahl, mtxinu, pacbell, sun}!rtech!gusano!ralph ralph%gusano@rtech.com

res@cbnews.ATT.COM (Robert E. Stampfli) (10/31/88)

In article <2507@rtech.rtech.com> ralph@rtech.rtech.com (Ralph Harnden) writes:
>When using "!command" to invoke commands from UA windows, it seems that UA
>fork/exec's /usr/lib/ua/uasetx, passing the parameters "/bin/sh -c command".
>Uasetx, in turn, seems to fork/exec the shell (first parameter) to invoke
>the command.  And the shell, in turn, fork/exec's the command.  
>
[ description of how to modify above pgms to use ksh ]
>
>Anybody:  Is there an easier way?  If not, I hope this helps....

I just moved /bin/sh and linked /bin/ksh as /bin/sh.  Seriously, I have yet to
find one thing that *doesn't* work because of this.

Rob Stampfli
att!cbnews!res (work)
osu-cis!n8emr!kd8wk!res (home)

bob@rush.cts.com (Bob Ames) (11/17/88)

In article <322@tarkus.UUCP>, jcs@tarkus.UUCP (John C. Sucilla) writes:
> In article <2507@rtech.rtech.com> ralph@rtech.rtech.com (Ralph Harnden) writes:
> >Anybody:  Is there an easier way?  If not, I hope this helps....
> 
> Anybody know if just linking ksh to sh would break anything?
> Who wants to be first to try it? :-)
> -- 
> John "C". Sucilla,  A silicon based life form.
>        {att,chinet,ddsw1}!tarkus!jcs
>   You have a better idea? Now's the time..

I've tried this on every OS that AT&T has sent out including 2.0, 3.0,
3.5, 3.5.1.4, 3.51.  I haven't tried it on 3.51a.

I've run for almost a year this way.  The biggest problems relate
to the history files.  It seems that certain programs, including
/usr/bin/Instcpio.sh, among others, don't work properly.  Usually
this seems to be related to the .kshistory files not being readable
(or writable).  Also, it'll run .kshrc every time UA tries to run
something.  I include things to run sysinfo (thanks, lenny), and
these always get executed even for simple stuff like 'Change passwd'.
Also, when I use the 'p' flag in the Office, things didn't work right,
but then again, even now, whenever I open a window with 'p', the
g----mn .kshistory gets owned by root with 600 perms.  This messes up
my next non-p shell.
I think I also had severe problems with ph dying all the time.

After much frustration, I have switched back to sh.  Has anyone tried
this with 3.51a?  I'd sure like to run ksh instead of sh, but I'm
no longer willing to try this.

I know someone who has been running ksh for at least a year now as /bin/sh
and he says it's no problem.

Bob Ames

National Organization for the    # Bob Ames       \ Marijuana: "The safest drug
Reform of Marijuana Laws, NORML  # 619-743-2546    \ in the world" (Source: DEA
"Marijuana is safer than Aspirin # bob@rush.cts.com \ Administrative Judge '87)
Caffiene Tobacco Alcohol Cocaine       ##### ..nosc! )..!crash!rush.cts.com!bob
Valium Heroin PCP Crack Crystal  # ..hplabs!hp-sdd! /   "We each pay a fabulous
Driving Flying Spaceflight and   # ..rutgers!ucsd! /    price - for our visions
causes about 0 deaths per year!" # Legalize Pot |-/   of paradise" - Neil Peart

hjespersen@trillium.waterloo.edu (Hans Jespersen) (11/19/88)

In article <776@rush.cts.com> bob@rush.cts.com (Bob Ames) writes:
=In article <322@tarkus.UUCP>, jcs@tarkus.UUCP (John C. Sucilla) writes:
=> In article <2507@rtech.rtech.com> ralph@rtech.rtech.com (Ralph Harnden) writes:
=> Anybody know if just linking ksh to sh would break anything?
=> Who wants to be first to try it? :-)
=
=I've tried this on every OS that AT&T has sent out including 2.0, 3.0,
=3.5, 3.5.1.4, 3.51.  I haven't tried it on 3.51a.
=
=[much descriptive stuff deleated]
=
=After much frustration, I have switched back to sh.  Has anyone tried
=this with 3.51a?  I'd sure like to run ksh instead of sh, but I'm
=no longer willing to try this.
=
=I know someone who has been running ksh for at least a year now as /bin/sh
=and he says it's no problem.
=

I've had the link going ever since I read the original posting (weeks ?) ago.
So far I have had no problems although I haven't conciously tried things that
might screw ksh up. My motivation for switching was so that my uucp shell
(~!) would give me korn shell. This way I can type 'ls -l foo' once and
then just ^k whenever I feel like checking on how my file transfer is going
(using ~% take).

------------------------------------------------------------------------------  
Hans Jespersen          UUCP : attcan!{uunet|utgpu}!watmath!trillium!hjespersen
University of Waterloo  
Waterloo, Ontario       VOICENET: (519)747-1721
------------------------------------------------------------------------------