Getting “command not found” error in bash script

前端 未结 6 1188
鱼传尺愫
鱼传尺愫 2020-12-02 00:27

I have written a bash script that gets three paths based on input parameters and then then gets the imagename/filename in the path.

Something like:
I provide:

6条回答
  •  离开以前
    2020-12-02 01:28

    $PATH is a special environment variable that contains a list of directories where your shell (in this case, bash) should look in when you type a command (such as find and ls.) Just try echo $PATH in a script or in a shell to get a feeling of what it looks like (you will typically have /bin, /usr/bin and /usr/local/bin listed there, maybe more.)

    As you don't really need to redefine this variable in this particular script, you should use another name than $PATH.

提交回复
热议问题