Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!mips!pacbell.com!ucsd!ucbvax!bloom-beacon!eru!hagbard!sunic!dkuug!resam!andrew From: andrew@resam.dk (Leif Andrew Rump) Newsgroups: comp.unix.internals Subject: Help me with a simple sed script please! Message-ID: <1991Mar21.111919.4126@resam.dk> Date: 21 Mar 91 11:19:19 GMT Organization: RESAM Project Office, SAS, CPHML-V Lines: 28 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@ambra.dk, phone: +45 39 27 11 77 / Currently at Scandinavian Airline Systems =======/ UUCP: andrew@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 andrew@resam.dk whiccccch may BeCoMe sOmEthIng like w@cph !%#@# @$$%$%(&**&(^%$ $#%%^&)(&^T^%^%^^# login: