相关疑难解决方法(0)

如何在单引号字符串中使用变量?

我只是想知道如何在单引号内回显变量(我使用单引号,因为字符串中有引号).

     echo 'test text "here_is_some_test_text_$counter" "output"' >> ${FILE}
Run Code Online (Sandbox Code Playgroud)

任何帮助将不胜感激

string bash shell echo

25
推荐指数
2
解决办法
4万
查看次数

Bash或GoogleCL:字符串参数中的新行

嗨,我正在使用GoogleCL 0.9.11版将视频上传到Youtube.我的操作系统是CentOS 5.5和Python 2.5.

其中一个字符串参数包含新行"\n",它无法正常显示.

google youtube post ~/videos/cat-falls-down-stairs.avi Comedy --tags "currency of the internet" --summary "Poor whiskers takes a tumble.\nShe's fine, though, don't worry."
Run Code Online (Sandbox Code Playgroud)

摘要页面显示为:

Poor whiskers takes a tumble.\nShe's fine, though, don't worry.
Run Code Online (Sandbox Code Playgroud)

但我想要:

Poor whiskers takes a tumble.
She's fine, though, don't worry.
Run Code Online (Sandbox Code Playgroud)

"\n"不会起作用.谁有解决方案?

非常感谢!

python bash command-line

1
推荐指数
1
解决办法
2062
查看次数

标签 统计

bash ×2

command-line ×1

echo ×1

python ×1

shell ×1

string ×1