8

I had a shell script that takes 3 parameters

test.sh a b c

I want to give each parameter in a new line

some thing like this :

test.sh a
        b
        c

i am on AIX Thanks.

user2711819
  • 960
  • 3
  • 16
  • 29
  • please explain a little bit of `why` you need to do this. Just for formatting? (Are you an SQL coder at heart?) . The solution below is the best you can do, given your basic problem definition. OR Are `a, b, c` really place holders for complex argument generation processes like calling scripts that caluclate values? Good luck! – shellter Jan 22 '15 at 23:20
  • For formatting .I am passing really a large string parameters . Thanks for your suggestion to add that to a variable. – user2711819 Jan 23 '15 at 15:45

1 Answers1

10

Just put \ at the end of line, it "escapes" the meaning of the character following it, which in this case is a newline.

test.sh a \
        b \
        c
Oliver W.
  • 13,169
  • 3
  • 37
  • 50
janisz
  • 6,292
  • 4
  • 37
  • 70