Script to read command line input and change it to some form

Hi,

I want to write a small code in which script changes command line input to some form.
Example

script.sh a1 a2 a3 a4 .....

output should be "a1|a2|a3|....."

Number of inputs in command line can be any variable

Very easy:

#!/bin/sh

IFS="|"
echo "$*"
1 Like

Thanks a lot.