I wanted to install a quite old package in my ubuntu computer using the .sh file I downloaded from their website. So, I tried typing in terminal:
and I got:
/bin/sh: 0: Can’t open ./package_name.sh
Briliant! Since you are here, you are probably looking for a fix.
The problem stems from the fact that Ubuntu uses dash as the default shell and your script is written with another shell in mind. The most usual is bash (sh).
So type in a terminal window:
sudo bash ./package_name.sh
This will force ubuntu to run the script using bash.
I wrote a simple bash script for monitoring changes in a webpage. I was able to find a couple or more such scripts on the web but non of those worked for https websites with non-valid cerfificates. So here is one that does:
while true; do
if [[ -f new_page.html ]]; then
mv new_page.html old_page.html
wget --tries=45 --wait=10 $1 -O new_page.html --no-check-certificate > /dev/null 2>&1
diff ./new_page.html ./old_page.html > /dev/null
if [[ $? -ne 0 ]]; then
echo "The webpage has changed!"
# mpg123 -q /home/user/latin_rhythm_guitar.mp3
echo "No change"
# sleep some time
The line mpg123 -q /home/user/latin_rhythm_guitar.mp3 is commented out. If you choose to play a song each time a change in the webpage occurs change the filename and un-comment.
Part of the source code is from the script found here.