bash - unexpected EOF while looking for matching in sorting script -


can please assist script here, fresh eyes, been working on while. so: @ end of script trying enable condition if user inputs single letter input script terminates/exits "exit" message:

#!/bin/bash echo 'enter file names (wild cards ok)' read files input_source in $files ;     if test -f "$input_source" ;          sort $input_source | uniq -c | head -10       elif "$input_source" = [a-z] ;         exit        echo 'exit'     fi done 

you have unterminated string literal:

elif "$input_source = [a-z] ;  # where's end? 

furthermore, once fix that, it's still not valid. you'll want use test, [, or [[, , then, = won't it. want this:

elif [[ "$input_source" =~ "^[a-z]$" ]]; 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -