执行shell命令并和输出结果另存为

来自linux中国网wiki
跳到导航 跳到搜索
cat cmd 
echo "ls /root/" >>log
ls /root/
echo "cat /etc/passwd" >>log
cat /etc/passwd

bash cmd >>log

see also

linux下如何编写批量执行命令?


批量复制及执行命令shell脚本


shell循环loop