Я хочу проверить, существует ли file2.sh
, а также если определенное слово, poet
является частью файла. Я использую grep
для создания переменной used_var
.
#!/bin/ksh
file_name=/home/file2.sh
used_var=`grep "poet" $file_name`
Как проверить, имеет ли значение used_var
значение?