Re: How to escape this?
- From: Robert Heller <heller@xxxxxxxxxxxx>
- Date: Mon, 19 May 2008 18:57:14 -0500
At Mon, 19 May 2008 05:48:02 -0700 (PDT) Why Tea <ytlim1@xxxxxxxxx> wrote:
On May 19, 2:27 pm, Alexandre Ferrieux <alexandre.ferri...@xxxxxxxxx>
wrote:
On May 19, 2:25 pm, Why Tea <ytl...@xxxxxxxxx> wrote:
Here is a shell command to find the current shell: ps -p $$ | tail -1
| awk '{print $NF}'.
How do you execute this in Tcl and get the output?
/Why Tea
Since the line is full of unix shellisms, feed it untouched to the
unix shell ;-)
exec sh -c {ps -p $$ | tail -1 | awk '{print $NF}'} 2>@ stderr
-Alex
Thanks Alex. It works. While it's working, it doesn't give me
the answer I want. My intention was to find out which shell
was used to launch tclsh or wish? E.g. if tclsh/wish is run
in tclsh, the command will give me "sh". Any idea of how to
get the original shell?
Did you try [info nameofexecutable] ?
--
Robert Heller -- Get the Deepwoods Software FireFox Toolbar!
Deepwoods Software -- Linux Installation and Administration
http://www.deepsoft.com/ -- Web Hosting, with CGI and Database
heller@xxxxxxxxxxxx -- Contract Programming: C/C++, Tcl/Tk
.
- References:
- Re: How to escape this?
- From: Why Tea
- Re: How to escape this?
- Prev by Date: Re: tcllib encyption aes compatibility
- Next by Date: Re: expect script doesnt pass graphics chars correctly
- Previous by thread: Re: OT clearcase question
- Next by thread: Re: How to escape this?
- Index(es):
Relevant Pages
|