« UKUUG lecture by Eric Raymond | Main | mozilla email client »

params?

writing bourne shell scripts, want to check for existance of command line params. try [ -z $1 ] which should tell me if the first command line param is empty. however all i get is "test: argument expected" when the param is not there. no good. annoying. discover bourne shell has a reserved var for the number of arguments passed, looking much like perl's - $#. so accomplish it by a simple [ $# -ne 1]. simple when you know how.

About

This page contains a single entry from the blog

The previous post in this blog was UKUUG lecture by Eric Raymond.

The next post in this blog is mozilla email client.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.33