linux - 通知发送导致选项数量无效

标签 linux bash shell notifications

我想做这个

while read line
do
    echo $line;
    notify-send $line;
done < "0.txt"

其中 0.txt 是一些有 10 行的文件

但问题是

notify-send $line;

导致选项数量无效,以及

notify-send "aasdasdsd" 

工作正常

最佳答案

bash 执行 Shell Parameter Expansion之前 Word Splitting .

notify-send "$line"

关于linux - 通知发送导致选项数量无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8850995/

相关文章:

linux - 如果参数 = x,则终止脚本

bash - 在 bash 脚本中,将所有错误视为成功退出(除了最后一个错误)的最佳方法是什么?

objective-c - 如何在 cocoa 中运行 shell 命令并获取输出?

linux - Emscripten 和空方 block

linux - Docker 中的 TCP、UDP 和 HTTP 服务器在启动容器后立即停止?

android - 如何从 linux 上用 android 手机调用电话?

git - EC2 上的启动脚本

linux - 等待机器启动时超时!! Vagrant-虚拟盒子

regex - 不允许父目录的文件路径的正则表达式

html - 如何使用 mailx 发送附件和 html 正文