[Ilugc] Echoing the current command

  • From: bala150985@xxxxxxxxx (Balasubramaniam Natarajan)
  • Date: Tue, 10 Sep 2013 11:35:03 +0530

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 .......


-- 
Regards,
Balasubramaniam Natarajan
www.blog.etutorshop.com

Other related posts: