Question: Can someone help me write a simple bash script that handles the following usage:

```
./application channels;message

eg:  ./application channel1 channel2 channel3;this is a message

```

so basically anything before the delimiter ; is channels separated by a space, and anything after the ; is the message.

Basically, i wanted to store each of these into a variale and print them out...

Answer: 
Since you require one message and one or more channels, it makes more sense to specify the message first, then assume that the rest of the arguments are channels. Something like

```
#!/bin/bash

message="$1"
shift  # Now each argument in $@ is a channel

```

Then your script could be run as follows

```
$ ./application "This is a message" channel1 channel2 channel3

```

While this how you typically handle required arguments, one drawback compared to using `-m` to specify the message is that it's harder to tell if the user forgot to specify the message

```
# Is "channel1" the message, or did the user forget to specify one?
$ ./application channel1 channel2 channel3

```

For implementing `-m`, I refer you to [Jonathan Leffler's answer](https://stackoverflow.com/a/14946888/1126841).
You can use the [cut](http://en.wikipedia.org/wiki/Cut_%28Unix%29) command: 

```
#!/bin/bash 
variables=`echo $* | cut -d';' -f1`
message=`echo $* | cut -d';' -f2`
echo "variables: " $variables
echo "message: " $message

```

Be sure to `\`-escape the semicolon:

```
$ ./application channels\;message
channels:  channels
message:  message

```