简体   繁体   中英

sed -i is not working on solaris system while removing 1st line from file

我试图从我不想创建任何额外文件的文件中删除第一行,我只想修改当前文件。在solaris机器上尝试了以下命令,但出现以下错误(sed:非法选项 - i),有人可以建议将其替换为solaris。

sed -i 1d currentFileName

You can use ed or vi :

ed -s currentFileName << EOF
1d
w
q
EOF

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM