Help me with a simple sed script please!

Leif Andrew Rump andrew at resam.dk
Thu Mar 21 21:19:19 AEST 1991


I'm creating a shell script that set up the DISPLAY environment variable:

	set remote = `who am i | grep "("`
	if "$remote" != "" then
	  setenv DISPLAY	cphxd3:0.0
	endif

I would like to make this shell script "global" so everybody could use it,
but that means that "cphxd3:0.0" must be replaced with whatever the user
is sitting at. I figured that a sed script could solve my problem but how?

	setenv	DISPLAY	`sed ??? $remote`:0.0

Leif Andrew


Leif Andrew Rump, AmbraSoft A/S, Stroedamvej 50, DK-2100 Copenhagen OE, Denmark
UUCP: andrew at ambra.dk, phone: +45 39 27 11 77                /
Currently at Scandinavian Airline Systems                =======/
UUCP: andrew at resam.dk, phone: +45 32 32 51 54                \
SAS, RESAM Project Office, CPHML-V, P.O.BOX 150, DK-2770 Kastrup, Denmark

NOTICE: 'Cause of SendMail ConFiGuRation FaultS weee may experiienc ProBleeems
wiiiiiiith our return add<zap> andrew at resam.dk whiccccch may BeCoMe sOmEthIng
like <wheee>w at cph<click> !%#@#
			      @$$%$%(&**&(^%$
					     $#%%^&)(&^T^%^%^^#
							       login:



More information about the Comp.unix.internals mailing list