这是我当前的代码部分执行上./不SH
#! /bin/bash
#Take no arguments in
#checks to see if home/deleted is in existence
#creates the directory or file if it is missing
**(line 15)** function checkbin(){
if [ ! -c "~/deleted" ]; then
mkdir -p ~/deleted
fi
if [ ! -f "~/.restore.info" ]; then
touch ~/deleted/.restore.info
fi
}
我可以把这个代码可以正确使用./remove [ARGS]
但是当我打电话使用sh remove [ARGS]
我收到以下错误remove: 15: remove: Syntax error: "(" unexpected
ls -l对文件-rwxr-x--x
unix是否支持sh和./的执行?
与./
/斌/庆典用于执行时(如在定义认领),而
sh
可以是另一种解释器或打坏,其可以根据它是如何被调用
sh
具有不同的特性的链路
SH将在Bourne shell中运行,而你想在bash执行。 –
调用'bash remove [ARGS]'或重写脚本sh。 – beliy