小编ari*_*sik的帖子

命令在本地工作,但在使用 ssh 调用时返回“未找到事件”

我想检查只读文件系统。我写了这个awk命令并且运行良好:

awk '{ if ( $4 ~ /ro,/ && $2 !~ /sys/ ) {print $2} }' /proc/mounts
Run Code Online (Sandbox Code Playgroud)

我想将此命令与ssh. 这不起作用:

$ ssh ip "awk '{ if ( $4 ~ /ro,/ && $2 !~ /sys/ ) {print $2} }' /proc/mounts"  
bash: !~: event not found
Run Code Online (Sandbox Code Playgroud)

我怎样才能做到这一点?问题是因为波浪号字符吗?

linux ssh bash special-characters

1
推荐指数
1
解决办法
2446
查看次数

标签 统计

bash ×1

linux ×1

special-characters ×1

ssh ×1