Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
从 shell 脚本中,我想为 Mac OS X 磁盘映像 (dmg) 创建空的 'Icon\r' 文件,以便查找器考虑 .VolumeIcon.icns 图标文件;控制台不接受该死的 '\r' 字符:
touch Icon\r ls Icon* > Iconr
尝试键入时会发生其他事情'Icon\r'等"Icon\r",我无法使其接受“\r”作为文件名末尾所需的典型回车符。
'Icon\r'
"Icon\r"
知道如何输入吗?
谢谢
我假设文件名应该是五个字符,最后一个是回车。在 bash 或 zsh 中:
touch $'Icon\r'
或者您可以在 shell 中键入回车:touch Icon Ctrl++ 。V CtrlM Enter
touch Icon
echo -e "Icon\\r" | xargs touch
在 bash 中,您可以打开引号并输入“图标”,然后在下一行(您的提示符应该是 > 字符)关闭引号。