Use regex for trimming file:// destinations
A problem with cut was causing:
$ DEST="file:///media/user/data"
$ TMPDEST=$(echo "${DEST}" | cut -c 6-)
$ echo $TMPDEST
///media/user/data
The fix uses a regex instead so that we trim away things correctly. It also seems somewhat more
readable.
This commit is contained in:
parent
dba25a57de
commit
6377ad5281
1 changed files with 1 additions and 1 deletions
|
|
@ -650,7 +650,7 @@ get_remote_file_size()
|
|||
;;
|
||||
"fi")
|
||||
FRIENDLY_TYPE_NAME="File"
|
||||
TMPDEST=$(echo "${DEST}" | cut -c 6-)
|
||||
TMPDEST="${DEST#file://*}"
|
||||
SIZE=$(du -hs "${TMPDEST}" | awk '{print $1}')
|
||||
;;
|
||||
"gs")
|
||||
|
|
|
|||
Loading…
Reference in a new issue