Bash question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi All,

I am trying to build a command line with spaces in the argument. This
demonstrates what I am trying to do. Clearly the first two commands work
fine. However, the last 4 lines to not.

/opt/libreoffice5.4/program/soffice.bin --headless --convert-to csv
"/tmp/file.xlsx"
/opt/libreoffice5.4/program/soffice.bin --headless --convert-to csv
"/tmp/file 2.xlsx"

MSG="file 2"
MSG="csv \"$MSG\""
echo $MSG
/opt/libreoffice5.4/program/soffice.bin --headless --convert-to $MSG

I am trying to make a variable containing spaces which is MSG. Then add to
that variable the argument csv.  The "echo" above prints the write stuff.
But when I try to use it in the last command its no longer valid and says
Source file could not be loaded.

What am I missing?  much searching hinted to arrays and using \$ but I
could not get that to work.

Thanks.

Jerry
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
https://lists.centos.org/mailman/listinfo/centos



[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]


  Powered by Linux