There are so many ways to throw this cat away.
JARS=' ./lib/apache-mime4j-0.6.jar; ./lib/apache-mime4j-0.6.jar; ./lib/bsh-1.3.0.jar; ./lib/cglib-nodep-2.1_3.jar; ./lib/commons-codec-1.6.jar; ./lib/commons-collections-3.2.1.jar; ./lib/commons-exec-1.1.jar; ./lib/commons-io-2.0.1.jar; ./lib/commons-io-2.3.jar; '
This gives you multi-line variable entry as per your question.
But if you plan to use these files in a shell script, you need to tell us how so that we can come up with the appropriate answers, instead of guessing us. For use in a shell script, files must be separated by something useful.
You asked, โHow can I do such a multi-line assignment in a shellโ, but the assignment in your example is actually a SINGLE line with ^
at the end of each input line, negating the next line of the new line (without avoiding it, as another answer suggested).
My solution in this answer is multi-line, but you will need to explain more about what you need to determine what will be useful.
For example, if you need to see a list of files that will be processed using the jar
command, you might have something like:
#!/bin/sh JARS=' ./lib/apache-mime4j-0.6.jar ./lib/bsh-1.3.0.jar ... ' set $JARS for jarfile in " $@ "; do jar xf "$jarfile" ... done
ghoti source share