what is wrong with my unix script

后端 未结 5 1071
温柔的废话
温柔的废话 2021-01-29 03:17
#!/bin/bash

while echo -n \"Player\'s name?\"
    read name
    [ $name != \'ZZZ\' ]
do
    searchresult=$(grep [$name] playername)
    if [ $searchresult = 0 ]
    the         


        
5条回答
  •  萌比男神i
    2021-01-29 03:24

    Quote the variable name:

    "$searchresult"
    

    Also, youa have other failures in the script.

    • remove brackets from the greps if you do not need them
    • rewrite the condition in while

提交回复
热议问题