clear history from shell
Tony Baechler
bats at batsupport.com
Mon May 16 12:39:04 UTC 2016
On 5/16/2016 5:18 AM, Grizzly wrote:
> I know this will be easy for most (if not all) of you but its been driving me
> mad all weekend, I have a simple script,
>
> #!/bin/sh
>
> history -c && history -w && exit
>
> each part was tested manually and the whole line has also been tested, but once
> I run the script it returns
>
> "3: Scripts/myclean.sh: history: not found"
>
First, try /bin/bash instead. On most systems, /bin/sh and /bin/bash are not
the same shell. Since "history" is a bash built-in command, it makes sense
that /bin/sh can't find it. Second, why not just remove .bash_history
instead? If the idea is to clear your shell history, this should work:
#!/bin/sh
rm ~/.bash_history
More information about the ubuntu-users
mailing list