[Ilugc] Echoing the current command

  • From: scorpionking.sahil@xxxxxxxxx (Sahil ModGill)
  • Date: Tue, 10 Sep 2013 11:58:45 +0530

On Tue, Sep 10, 2013 at 11:55 AM, Shrinivasan T <tshrinivasan at 
gmail.com>wrote:

On Tue, Sep 10, 2013 at 11:35 AM, Balasubramaniam Natarajan
<bala150985 at gmail.com> wrote:

Hi

How do I echo the current command which I typed in bash ?  I know that
our
current command goes and sit's in the value of "$0"  However when I try
putting this inside .bashrc it does not give me correct results.



If you're trying to update the title of the xterm, you can use a DEBUG
trap:

trap 'echo "$BASH_COMMAND"' DEBUG

Not the same as you expect.
But it gives the command name executed.

Thanks to :

http://stackoverflow.com/questions/5077836/bash-how-to-find-current-shell-command



Sorry for my last reply. I found what exactly you want.
Command is: *!$*

http://www.computerhope.com/ushort.htm


 --

Regards,
T.Shrinivasan

My Life with GNU/Linux : http://goinggnu.wordpress.com
Free E-Magazine on Free Open Source Software in Tamil : http://kaniyam.com

Get CollabNet Subversion Edge :     http://www.collab.net/svnedge
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
ILUGC Mailing List Guidelines:
http://ilugc.in/mailinglist-guidelines




-- 
*Regards,
Sahil ModGill*

Other related posts: