需求: shell读取文件内容,然后把内容赋值给变量然后进行字符串处理 实现: dataline=$(cat /root/data/data.txt) echo $dataline 转载于:https://www.cnblogs.com/qiangyuzhou/p/10791754.html