Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-23-2010, 02:29 PM   #1
LQ Newbie
Registered: Oct 2003
Posts: 4

Rep: Reputation: 0
Shell variable storing the previously executed command

I want to use PROMPT_COMMAND variable to build a history of all the commands i execute. So Basically i want to append the last executed command to my own command log file. How can i find the last executed command ?

I want to add PROMPT_COMMAND="echo $last_executed_command >> my_command_log" But I am not sure how to find the last executed command
Old 05-23-2010, 02:46 PM   #2
LQ 5k Club
Registered: May 2003
Location: London, UK
Distribution: Debian "Testing"
Posts: 6,117

Rep: Reputation: 416Reputation: 416Reputation: 416Reputation: 416Reputation: 416
What is wrong with the command history ?
Old 05-23-2010, 02:50 PM   #3
LQ Newbie
Registered: Oct 2003
Posts: 4

Original Poster
Rep: Reputation: 0
What i intend to do finally is have a single file that stores history of all the commands i run from the different systems i work from.

And I want unlimited history log not limited by HISTSIZE


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble storing a variable in a shell script after awk output uncle-c Linux - Newbie 3 02-08-2010 08:13 AM
executing Bourne shell variable as command? ocicat Programming 3 07-31-2007 03:00 AM
Write output or command to variable (shell) kernel_geek Programming 9 03-12-2007 05:45 AM
storing output of sed in a variable in shell script Fond_of_Opensource Linux - Newbie 1 11-09-2006 04:57 AM
removing only most previously executed command from history? jagroop mand Linux - Newbie 2 01-19-2005 06:39 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:26 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration