Bash or GoogleCL: new line in string parameter

HI, I use GoogleCL version 0.9.11 to upload videos to Youtube. My OS is CentOS 5.5 and Python 2.5.

One of the line parameters contains a new line "\ n", and it cannot be displayed correctly.

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

Display summary page:

 Poor whiskers takes a tumble.\nShe fine, though, don't worry. 

But I want:

 Poor whiskers takes a tumble. She fine, though, don't worry. 

"\ n" will not work. Who has a solution?

Thank you so much!

+1
python command-line bash
source share
3 answers

You can use the Bash $'' construct to expand the escape sequences before passing them to googlecl.

 google youtube post ~/videos/cat-falls-down-stairs.avi Comedy \ --tags 'currency of the internet' \ --summary $'Poor whiskers takes a tumble.\nShe'\' fine, though, don'\''t worry.' 
+9
source share

Just put acutal new line in line. Bash knows how to handle multi-line strings if you just hit enter in the middle.

 google youtube post ~/videos/cat-falls-down-stairs.avi Comedy --tags "currency of the internet" --summary "Poor whiskers takes a tumble. She fine, though, don't worry." 
+1
source share

googlecl is a python application. Exit \n with \ and enter your line as "Poor whiskers takes a tumble.\\nShe fine..." . Perhaps this will help.

0
source share

All Articles