如何使用echo命令打印#!/bin/bash [英] How to print #!/bin/bash using echo command

查看:737
本文介绍了如何使用echo命令打印#!/bin/bash的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了转义字符,但似乎不起作用. 我需要使用脚本来自动配置软件包.

I have tried the escape character but it doesn't seems works with !. I need this to auto-configure packages using scripts.

推荐答案

!在默认的交互式bash会话中很神奇,但在脚本中却没有(在交互式提示中禁用set +H).无论如何:

! is magic in a default interactive bash session, but not in scripts (set +H to disable in an interactive prompt). In any case:

echo '#!/bin/bash'

这篇关于如何使用echo命令打印#!/bin/bash的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆