Results 1 to 4 of 4
So when you type history in bash you get a list of your history...however I'm trying to get the same output into my bash script but its not working. I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 09-05-2011 #1Just Joined!
- Join Date
- May 2006
- Posts
- 8
displaying history in a script
So when you type history in bash you get a list of your history...however I'm trying to get the same output into my bash script but its not working. I do
and nothing outputs, I've tried a few things such asCode:#!/bin/bash history
but still no luck, any ideas?Code:echo history, or echo $history
Thank you,
- 09-05-2011 #2
Try this:
Code:#!/bin/bash cat .bash_history
Jay
New users, read this first.
New Member FAQ
Registered Linux User #463940
I do not respond to Private Messages asking for Linux help. Please, keep it on the public boards.
- 09-07-2011 #3Just Joined!
- Join Date
- May 2006
- Posts
- 8
Sorry I made a mistake, I need to find the current history number. I tried
but it still says that I need to specify a numeric number. Any ideas?history ! 0
Thank you
- 09-08-2011 #4
What exactly do you mean by 'current history number'?
Jay
New users, read this first.
New Member FAQ
Registered Linux User #463940
I do not respond to Private Messages asking for Linux help. Please, keep it on the public boards.


Reply With Quote
