Linux Shell脚本编程的注意事项

greatefanli 8 0 PDF 2021-01-16 23:01:12

一、常用技巧 代码如下:ssh user@server bash < /path/to/local/script.sh#ssh到远程服务器执行一个脚本,此命令可以避免将脚本上传到远程服务器ssh user@host cat /path/to/remotefile | diff /path/to/localfile –#比较远程文件和本地文件的差异vim scp://username@host//path/to/somefile#vi一个远程文件curl ifconfig.me#在内网下查看公网ipecho ${#a}#取变量字符个数FUNCNAME#函数名变量,打印该变量会输出当前的函

用户评论
请输入评论内容
评分:
暂无评论