简体   繁体   中英

sh file not found in linux command line

I'm an owner of synology's diskstation NAS server running on special OS (mainly linux)

It has only access from inte.net. I established command line interface to access it using synology wiki. Now I try to install Counter-Strike server on it using SteamCMD. I just look in Valve Developer Community for it.

I'm writing the next:

mkdir csServer  
cd csServer
wget http://media.steampowered.com/client/steamcmd_linux.tar.gz
tar xvfz steamcmd_linux.tar.gz
./steamcmd.sh

But the last line causes -sh: ./steamcmd.sh not found . However, I can see this file in the directory.

在此处输入图像描述

What actually can cause it?

//ADDED

The file is executable!

在此处输入图像描述

Your script contains a header which says #!/bin/bash , that is use /bin/bash to execute this script . Apparently, on your system /bin/bash is not present. I am not familiar with Synology environment, but you should be able to fix this problem by installing bash and then pointing your script to the right path, which should be /opt/bin/bash . The first line of your script should therefore look like the following

#!/opt/bin/bash

You could also use Synology default ash , but beware that you script might not work as it was written for bash .

Windows style end-of-lines (CRLF) can cause this issue. If your sh file contains Windows style end-of-lines, convert it to Linux style.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM