开发者

How to create the empty 'Icon\r' file for a .dmg from shell script?

开发者 https://www.devze.com 2023-01-22 11:20 出处:网络
From shell script, I would like to create the empty \'Icon\\r\' file for a Mac OS X d开发者_开发问答isk image (dmg), so as the .VolumeIcon.icns icon file is taken into account by the finder; the damn

From shell script, I would like to create the empty 'Icon\r' file for a Mac OS X d开发者_开发问答isk image (dmg), so as the .VolumeIcon.icns icon file is taken into account by the finder; the damn '\r' character is not accepted from the console:

touch Icon\r
ls Icon*

> Iconr

and other things happen when trying to type 'Icon\r', "Icon\r" etc., I can't achieve to make it accept "\r" as the typical carriage return required at the end of the file name.

Any idea how to type it?

Thanks


I assume the file name should be five characters, the last one being a carriage return. In bash or zsh:

touch $'Icon\r'

Or you can type the carriage return in the shell: touch Icon Ctrl+V Ctrl+M Enter .


echo -e "Icon\\r" | xargs touch


In bash, you can open your quotes and type "Icon, then on the following line (your prompt should be a > character) close the quotes.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号