0

how do i write of if statement that does

If [[$word contain character other than alphabet]]
   echo "stop"
fi
Sion12 C
  • 3
  • 3
  • `[[ $word = *[![:alpha:]]* ]] && echo "stop"` – Charles Duffy Oct 21 '22 at 17:33
  • The linked duplicate is for "alphanumeric", but take out the numeric bits of the spec from any answer there and you have an alpha-characters-only answer. – Charles Duffy Oct 21 '22 at 17:34
  • btw, as you can see in the first comment above, `[[ ]]` is not part of `if`; you can use it without `if`, just as you can use `if` to test exit status of commands other than `[[` or `[`. – Charles Duffy Oct 21 '22 at 17:39

0 Answers0