mount -t cifs дает сбой, если пароль не читается из подсказки, как исправить?

Вы можете защитить попытку mv, убедившись, что исходный файл существует, прежде чем пытаться переименовать его:

test -f /prod/new/outputlog/error.log &&
    mv /prod/new/outputlog/error.log /prod/hist/new/outputlog/error.log.32423423424

Или вы можете перехватить сообщение об ошибке и попытаться разделить его на две строки:

mv /prod/new/outputlog/error.log /prod/hist/new/outputlog/error.log.32423423424 2>&1 |
    fmt -s -w80 >&2
0
11.12.2019, 17:18
1 ответ

Лучше использовать файл учетных данных

-o credentials=filename|cred=filename
specifies a file that contains a username and/or password and optionally the name of the  workgroup.
The format of the file is:

username=value
password=value
domain=value
0
28.01.2020, 03:01

Теги

Похожие вопросы