[Ilugc] Echoing the current command

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

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.

$ fc -ln 0 gives what I typed in previously not the current command.

For example:

$ ls
The current cmd you typed is: ls
. .. Pictures Document
$ clear
The current cmd you typed is: clear
$ who
The current cmd you typed is: who
bla bla bla .......


I don't think so that there is any such way to get this. BTW you can alter
the 'history' command according to your need (that's another way around).
If there is any way to do this then I am eager to execute that.

-- 
*Regards,
Sahil ModGill*

Other related posts: