Help with first bash script please

Graham Cossey graham at cossey.plus.com
Thu Oct 21 15:06:00 UTC 2004


I'm going nowhere at the moment with this VERY simple bash script, can
someone help please?

All I need to do is check the value of one of the command line parameters
and conditionally perform a task

1 #!/bin/bash
2 printf "Type = $6"
3 if [$6 == 'F']
4 then
5    Do the task
6 fi
7 Do other tasks

I keep getting:

Type = Q
line 3: [Q: Command not found

Also, does someone have a 'simple' bash scripting resource they could point
me to? I can find plenty of advanced scripting pages but founf nothing with
the above example that worked.

TIA

Graham





More information about the fedora-list mailing list