You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.
I want to parse the output of the upload command line by line with a while loop in a shell script. However, gdrive doesn't print new updates (e.g. updated progress percentage) to new lines on stdout, I think it uses \r to remove the last line so it looks like there is only one output line that is constantly getting updated.
I am trying to convert all \rs into \ns with this script, but it isn't working. It keeps printing the gdrive output instead of the inside of the while loop.
gdrive upload "$FILE" \
| tr '\r' '\n' \
| while read LINE; do
echo "do something with: $LINE"
done
Any ideas how to fix this script (or is this a bug in gdrive)?
The text was updated successfully, but these errors were encountered:
I want to parse the output of the upload command line by line with a while loop in a shell script. However,
gdrive
doesn't print new updates (e.g. updated progress percentage) to new lines on stdout, I think it uses\r
to remove the last line so it looks like there is only one output line that is constantly getting updated.I am trying to convert all
\r
s into\n
s with this script, but it isn't working. It keeps printing the gdrive output instead of the inside of the while loop.Any ideas how to fix this script (or is this a bug in
gdrive
)?The text was updated successfully, but these errors were encountered: