I would like to know what is the error in the below script
i get error as : command not foundh: line 1: , : command not foundh: line 2: its continuous
i have tried add ; but now working kindly tell me what to do ??
#!/bin/bash;
clear;
FILEREPO=http://192.168.1.2/cpplugin;
echo "-----------------------------------------------";
echo " Welcome to C-Panel Login Alert Installer";
echo "-----------------------------------------------";
cd /var/cpanel/;
mkdir perl5
cd perl5/
mkdir lib
cd lib/
wget $FILEREPO/LoginAlerthook.zip
unzip LoginAlerthook.zip
rm -r LoginAlerthook.zip
cd /
/usr/local/cpanel/bin/manage_hooks add module LoginAlert
chmod 777 LoginAlert.pm
echo " "
echo " Login Alert Script Hooked With C Panel Finished"
echo " "
The fact that you’re getting the funny output is a sure bet that your script has carriage return (CR) characters at the end of the lines, usually a symptom of using Windows editors that assume line endings should be CR/LF rather than just the standard UNIX LF (linefeed). That is causing error output like:
and because the CR is putting the cursor back at line start, it’s overwriting some of it:
making:
Examine your script with
od -xcb scriptnameto check for CR (displayed as\r) characters, you can also pipe the script output throughod -xcbto see the real output. For example is a file I created withhellofollowed by a carriage return on the one and only line:You can see the CR (
\r) in there.If that is the problem, simply remove the CR characters such as piping it through
tr -d '\r'.Executing
cat hello.txt | tr -d '\r' | od -xcbshows that you can get rid of it:In your case, assuming your script is called
freak.bash, you would use:and
newfreak.bashwould be the one without the offending characters.