фокус: убрать -e
p.s. кстати, этот скрипт ни разу не bash. а конкретно shell-скрипт
p.p.s. секрет фокуса:
Shell
$ sh -e -c 'zz;echo 123'
sh: zz: command not found
$ sh -c 'zz;echo 123'
sh: zz: command not found
123
p.p.p.s. объяснение фокуса в man sh
Shell
$ man -P cat sh 2>/dev/null | grep -A 7 'Exit *immed'
-e Exit immediately if a simple command (see SHELL GRAMMAR
above) exits with a non-zero status. The shell does not
exit if the command that fails is part of the command
list immediately following a while or until keyword,
part of the test in an if statement, part of a && or пїЅпїЅпїЅпїЅпїЅпїЅ
list, or if the command’s return value is being inverted
via !. A trap on ERR, if set, is executed before the
shell exits.
Немогу понять какое отношение имеет одно к другому
А что есть одно, и что есть другое?
Цитата
sh is a symlink to the bash program. When invoked as sh, bash tries to mimic the startup behavior of historical versions of sh as closely as possible, while conforming to the POSIX standard as well.
Немогу понять какое отношение имеет одно к другому
А что есть одно, и что есть другое?
Цитата
sh is a symlink to the bash program. When invoked as sh, bash tries to mimic the startup behavior of historical versions of sh as closely as possible, while conforming to the POSIX standard as well.
пробовал
$variable >/boot/grub/device
не вписывает туда содержимое переменой
echo $variable > filename
А прочитать файл в переменую будет?
echo filename > variable ?
И еще такой вопрос если мне нужно добавить или изменить строчку в файле то единственый метод это?
Прочесть файл в переменую сделать изменения в переменой и потом сохранить ее в файл или есть и более прямые пути?