复制路径中的文本(Bash)

时间:2018-10-17 08:00:26

标签: linux bash

我正在尝试在此路线上复制此信息 /usr/share/applications/program.desktop

[Desktop Entry]
Name=PhpStorm
Type=Application
Exec=/opt/PhpStorm-182.4129.45/bin/phpstorm.sh
Icon=/opt/PhpStorm-182.4129.45/bin/phpstorm.png
Comment=Integrated Development Environment
Categories=GNOME;GTK;Development;IDE;
StartupNotify=true
MimeType=text/plain;

我将不得不对现有脚本进行调整,因为这是最理想的方式?

谢谢。

1 个答案:

答案 0 :(得分:0)

您可以使用cat:

cat > /usr/share/applications/program.desktop <<EOF
[Desktop Entry]
Name=PhpStorm
Type=Application
Exec=/opt/PhpStorm-182.4129.45/bin/phpstorm.sh
Icon=/opt/PhpStorm-182.4129.45/bin/phpstorm.png
Comment=Integrated Development Environment
Categories=GNOME;GTK;Development;IDE;
StartupNotify=true
MimeType=text/plain;

EOF