Discussion:
Create a file with history in sh
Rocky Hotas
2014-06-18 12:45:59 UTC
Permalink
Hello!
I am quite new with this mailing-list.
During the installation of NetBSD, I choose /bin/sh as the default root and user shell.
In the users' home directories there are not files like .sh_history or similar and no "history-like" files are updated when I log in or log out. But I would like to keep trace of all the commands typed in the terminal, the last 100 or 1000, and not only the ones typed in the current login session, accessible with the up arrow.
Reading the sh manual I didn't find the possibility to create a permanent file with history like in bash or ksh.
Is it true or there exist some possibility to do this? Or where I can look for this option?
With Google I didn't find more.
This seemed the best place for my question, but please give me any suggestion if I am someway wrong.
Thank you!

Rocky
Iain Hibbert
2014-06-18 20:51:14 UTC
Permalink
Post by Rocky Hotas
Hello!
I am quite new with this mailing-list.
During the installation of NetBSD, I choose /bin/sh as the default root and user shell.
In the users' home directories there are not files like .sh_history or similar and no "history-like" files are updated when I log in or log out. But I would like to keep trace of all the commands typed in the terminal, the last 100 or 1000, and not only the ones typed in the current login session, accessible with the up arrow.
Reading the sh manual I didn't find the possibility to create a permanent file with history like in bash or ksh.
Is it true or there exist some possibility to do this? Or where I can look for this option?
On NetBSD /bin/sh is a very basic shell (by intention), and it doesn't
have this feature.

you could use /bin/ksh instead, which does have this feature, or /bin/csh

regards,
iain
Paul Goyette
2014-06-18 21:04:11 UTC
Permalink
Post by Iain Hibbert
Post by Rocky Hotas
Hello!
I am quite new with this mailing-list.
During the installation of NetBSD, I choose /bin/sh as the default root and user shell.
In the users' home directories there are not files like .sh_history or similar and no "history-like" files are updated when I log in or log out. But I would like to keep trace of all the commands typed in the terminal, the last 100 or 1000, and not only the ones typed in the current login session, accessible with the up arrow.
Reading the sh manual I didn't find the possibility to create a permanent file with history like in bash or ksh.
Is it true or there exist some possibility to do this? Or where I can look for this option?
On NetBSD /bin/sh is a very basic shell (by intention), and it doesn't
have this feature.
you could use /bin/ksh instead, which does have this feature, or /bin/csh
Or pkgsrc/shells/tcsh


-------------------------------------------------------------------------
| Paul Goyette | PGP Key fingerprint: | E-mail addresses: |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer | | pgoyette at netbsd.org |
-------------------------------------------------------------------------
Loading...