Mailinglist Archive: opensuse (4631 mails)

< Previous Next >
Re: [opensuse] Bash script which read command option
  • From: "Dominique Leuenberger" <Dominique.Leuenberger@xxxxxxxxxxxxx>
  • Date: Thu, 18 Jan 2007 15:58:07 +0100
  • Message-id: <45AFA71E.2554.0029.1@xxxxxxxxxxxxx>
>>> On 18-01-2007 at 16:34, jan kalcic <jandot@xxxxxxxxxxxxxx> wrote:
> Hi People,
>
> How can I have my bash script read the option I pass in command
line?
>
>
> Let's suppose the script looks like this:
>
> #!/bin/bash
>
> ping -c "?" 192.168.1.1
>


Variables will be your friend in this case.

$1 being the first parameter, $2 the 2nd, and so on...

man bash is probably a good start for you too.

dominique
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups
References