Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

linux set multiline variable

# If you're trying to get the string into a variable, another easy way is something like this:

USAGE=$(cat <<-END
    This is line one.
    This is line two.
    This is line three.
END
)

#If you indent your string with tabs (i.e., '	'), the indentation will be stripped out. If you indent with spaces, the indentation will be left in.

#NOTE: It is significant that the last closing parenthesis is on another line. The END text must appear on a line by itself.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #linux #set #multiline #variable
ADD COMMENT
Topic
Name
1+9 =