LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 05-23-2010, 01:29 PM   #1
late_nighter
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, 01:46 PM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
What is wrong with the command history ?
 
Old 05-23-2010, 01:50 PM   #3
late_nighter
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
 
  


Reply



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 07:13 AM
executing Bourne shell variable as command? ocicat Programming 3 07-31-2007 02:00 AM
Write output or command to variable (shell) kernel_geek Programming 9 03-12-2007 04:45 AM
storing output of sed in a variable in shell script Fond_of_Opensource Linux - Newbie 1 11-09-2006 03:57 AM
removing only most previously executed command from history? jagroop mand Linux - Newbie 2 01-19-2005 05:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:35 AM.

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