I'm trying to stock the output of a script in a variable. Here is the code of my script (delete.sh) :
#!/bin/bash
echo "Suppression de $1" >> /share/MD0_DATA/remotesync/delete.log
log=$(/share/MD0_DATA/remotesync/remoteSync -rm "$1")
echo $log >> /share/MD0_DATA/remotesync/delete.log̀
When I exec this script I got that in output :
[/share/MD0_DATA/.qpkg/remotesync] # soft/delete.sh "archivesPAO/3MONTAGE BORNE OZ 275x155.psd"
drivers : ("QMYSQL3", "QMYSQL", "QSQLITE")
Table hubicobject & hubicobjectLocal sucessfully reseted
Load container Object
" ATTENTION recuperation du prefix : archivesPAO/3MONTAGE BORNE OZ 275x155.psd"
Credentials
Refresh Token
"Upload : 100% 0.00 octets/s fin dans : 00:00:00"
"Download : 100% 0.00 octets/s fin dans : 00:00:00"
"Download : 100% 0.00 octets/s fin dans : 00:00:00"
"https://lb9911.hubic.ovh.net/v1/AUTH_f5cb82ec59a615a1c56053608e0c6123"
"Download : 100% 0.00 octets/s fin dans : 00:00:00"
"Download : 100% 0.00 octets/s fin dans : 00:00:00"
"Temps pour inserrer 10000 entree : 0 ms"
[/share/MD0_DATA/.qpkg/remotesync] # cat soft/delete.log
Suppression de archivesPAO/3MONTAGE BORNE OZ 275x155.psd
So I don't understand why I cannot stock this output in my shell variable. Maybe it's because I work on a QNAP QTS 4.0 ? But I don't think so.