外壳的bash,如何呼应单引号内变量 [英] shell bash, how to echo variables inside single quotes

查看:105
本文介绍了外壳的bash,如何呼应单引号内变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道我怎么能呼应单引号内的变量(我用单引号作为字符串有引号的话)。

I am just wondering how I can echo a variable inside single quotes (I am using single quotes as the string has quotation marks in it).

     echo 'test text "here_is_some_test_text_$counter" "output"' >> ${FILE}

任何帮助将大大AP preciated

any help would be greatly appreciated

推荐答案

您不能。

 echo 'test text "here_is_some_test_text_'"$counter"'" "output"' >> ${FILE}

这篇关于外壳的bash,如何呼应单引号内变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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