bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I find the -c argument?


From: Chet Ramey
Subject: Re: How can I find the -c argument?
Date: Fri, 15 Apr 2005 14:51:48 -0400
User-agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317)

Paul D. Smith wrote:
> This isn't a bug, actually.  I'm wondering if there's any way to access
> the string provided with the -c option to the shell, from within the
> shell init files.
> 
> 
> For example, if I run this;
> 
>     bash --login -c 'echo hi'
> 
> How can I find the string 'echo hi' from within my ~/.bash_profile?  I
> tried the obvious but it isn't in $@ and it's not sitting in stdin
> waiting for me.  Is there any way to retrieve that string from within my
> shell setup?

The $BASH_EXECUTION_STRING variable exists in bash-3.0 for this purpose.
The $BASH_COMMAND variable may also be used, but that will probably be
overwritten before you can make any use of it.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                                Live...Laugh...Love
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]