I have a simple script that terminates some processes and closes ports as below. I am running metasploitable
.
However, whenever I run this, it gives the below error. (note that on this file everyone has permissions)
I have a simple script that terminates some processes and closes ports as below. I am running metasploitable
.
However, whenever I run this, it gives the below error. (note that on this file everyone has permissions)
to run a script it must be executable chmod +x portblock.sh
then to run it you must add ./ in the beginning
./portblock.sh
First of all make sure you have executable permission for your script.
And then,
Run your script using ./portblock.sh
or using sh portblock.sh
.
If you don't like to run the script with above mentioned way then update your PATH
variable to the script directory.
sed -i s/\r//
)
– Archemar
Dec 02 '16 at 14:53
dos2unix
. Line endings should use LF not CRLF.
– Thushi
Dec 02 '16 at 15:05