clear history from shell

Chris Green cl at isbd.net
Mon May 16 13:21:55 UTC 2016


On Mon, May 16, 2016 at 01:18:33PM +0100, Grizzly wrote:
> Hi All
> 
> 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"
> 
> any pointers to what stupid error I made please
> 
You're running the script in sh (the #!/bin/sh line) rather than the
default bash and sh doesn't have the history command.

Just change the first line to #!/bin/bash.

-- 
Chris Green




More information about the ubuntu-users mailing list