usage of history command inside shell script
Hi All,
I need to write a script which requires to display the output for the shell commands. I am able to retrieve the result for "ls" but the "history" command execution is failed. Please let me know if there a way to specify the history command inside the shell script and get the output of it. Sample Script: #!/bin/bash ls history Rgrds, saheb |
remove #!/bin/bash
it will work. |
Not able to execute the history command.
Please find the error message. [s9:~]cat a.sh ls history [s9:~]sh a.sh a.sh logs bin classes conf jre lib local.cshrc local.login local.profile a.sh: history: not found [s9:~] |
Quote:
|
change the permission
Quote:
give the permission to the script.. chmod 755 a.sh or chmod 777 a.sh then execute, you will get the output regards, senthil.P |
All times are GMT -5. The time now is 07:22 AM. |