0

我有一个脚本mount-gdrive-encrypted.command

#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
rclone mount gdrive-encrypted:/ /Users/John/Documents/Mount -vv

当我双击执行此脚本时:

Last login: Sun Jul 14 12:52:28 on ttys001
Johns-MacBook-Air:~ John$ /Users/John/Documents/mount-gdrive-encrypted.command ; exit;
2019/07/14 12:52:41 DEBUG : rclone: Version "v1.47.0" starting with parameters ["rclone" "mount" "gdrive-encrypted:/\u00a0/Users/John/Documents/Mount" "-vv"]

Command mount needs 2 arguments minimum: you provided 1 non flag arguments: ["gdrive-encrypted:/\u00a0/Users/John/Documents/Mount"]
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

\u00a0似乎是在运行时添加的,导致 rclone 认为我的源和目标是一个字符串而不是两个。

我尝试像这样替换它,但没有运气:

#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
cmd="rclone mount gdrive-encrypted:/ /Users/John/Documents/Mount -vv"
cmd="${cmd//\u00a0/ }"
eval $cmd

rclone 命令在手动运行时起作用。如何更改脚本以阻止添加此非破坏空间?

4

0 回答 0