Shell tricks - Programming On Unix
Users browsing this thread: 2 Guest(s)
|
|||
Inserting raw data in a script
How to embed a text object in a shell script? You can use quotes: Code: printf 'Oh noes Two problems: - The ' often used in various languages clashes with the quotes. - printf(1) (like echo, sometimes...) interprets the \t. Code: printf '\\t\n' # not convenient The last one is our solution: you can quote 'EOF', and this stops all expansion on the following text. So you can have any text including mixed ' and " quotes along with $, \ and whatnot. And yes, that is POSIX. |
|||
Messages In This Thread |
Shell tricks - by josuah - 13-11-2017, 05:27 AM
RE: Shell tricks - by josuah - 13-11-2017, 05:39 AM
RE: Shell tricks - by venam - 14-11-2017, 01:53 AM
RE: Shell tricks - by josuah - 23-11-2017, 07:59 AM
RE: Shell tricks - by josuah - 23-11-2017, 08:52 AM
RE: Shell tricks - by josuah - 04-12-2017, 07:43 AM
RE: Shell tricks - by z3bra - 04-12-2017, 08:11 PM
RE: Shell tricks - by josuah - 05-12-2017, 08:07 AM
RE: Shell tricks - by josuah - 05-12-2017, 09:02 AM
RE: Shell tricks - by josuah - 05-12-2017, 09:08 AM
RE: Shell tricks - by josuah - 08-12-2017, 12:25 PM
|