0

我在学校的 ubuntu 机器上制作并测试了这个 bash 脚本,然后我回家在 Windows 10 Bash 上使用它,我收到了这些错误:

./newflask.sh: line 8: syntax error near unexpected token `else'
'/newflask.sh: line 8: `    else

这是代码:

 #!/bin/bash

if [ $# -eq 0 ]; then
      echo "No arguments supplied"
else
    if [ -d $1 ]; then
    echo "Directory exists"
    else 
        mkdir $1
        cd $1
        touch $1.py
        mkdir templates
        mkdir static
        mkdir utils
        mkdir data
        cd utils
        touch __init__.py
        cd ..
    fi
fi

谢谢

4

0 回答 0