#334 Issue closed: No such file or directory in lib/sesam-functions.sh

Florent38 opened issue at 2013-11-21 13:01:

Hi,
When rear start, there is an error in file /usr/share/rear/lib/sesam-functions.sh line 18.

rear mkrescue -v
/usr/share/rear/lib/sesam-functions.sh: line 18: : No such file or directory
Relax-and-Recover 1.15-git201311181354 / 2013-11-18

SM_INI=$(grep SM_INI /etc/sesam2000.ini 2>/dev/null | cut -d '=' -f 2)
while IFS== read key value ; do
...
done <"$SM_INI"

gdha commented at 2013-11-22 17:45:

see issue #330 - this case can be closed?

Florent38 commented at 2013-11-25 08:13:

No,
Because the error "No such file or directory" is still present with latest git version.
The error is in line 18 of sesam-functions.sh : done <"$SM_INI" because Bash try to open the file found by the grep command, if the file doesn't exist, this error appears. Rear should test the existence of the file before the while loop.

gdha commented at 2013-11-25 08:35:

in the github https://github.com/rear/rear/blob/master/usr/share/rear/lib/sesam-functions.sh
there is a test to avoid this I believe: [[ -z "$SM_INI" ]] && return
could you double check?

Florent38 commented at 2013-11-25 09:39:

Sorry, I didn't see this commit (i have pulled the repositories just before the commit of the test...).
I close the issue ;)


[Export of Github issue for rear/rear.]