Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Feb 2017 17:25:46 -0500
From:      "James B. Byrne" <>
To:        "Garance A Drosehn" <>
Cc:        "Polytropon" <>,
Subject:   Re: Variable assignment in sh
Message-ID:  <>
In-Reply-To: <>
References:  <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help

On Wed, February 1, 2017 19:21, Garance A Drosehn wrote:

> On something of minor tangent, if you're writing scripts in either
> 'sh'
> or 'bash', you may find the following web site helpful:

I just wish to clarify something here.  What I am doing is attempting
to reuse a one-liner that has one conditional in it.  I do not
consider that to be scripting or programming.  I am just piping a few
tools together and checking if anything comes out the end.

I have written bash scripts of course, but those things tend to look
like this:

#!/usr/bin/env bash

SCRIPT_NAME=$(basename $0)
AUTHOR="<James B. Byrne>"

# Maximum number of arguments allowed by this program

# Minimum number of arguments required by this program

SCRIPT_PATH=$(dirname $0)

cat >&2 << EOD

Version: $VERSION
Usage: $SCRIPT_NAME [options] [arguments]

# Purpose of script:
#    This is a script template with examples of getopts usage

This script supports the following options:
  -h        Show this message and exit with failure status 2
  -a=value  set option a to value
  -b=value  set option b to value
  -d=level  set debug level to level
. . .

Today when I script then I tend to use Ruby.  Tomorrow? Who knows?

***          e-Mail is NOT a SECURE channel          ***
        Do NOT transmit sensitive data via e-Mail
 Do NOT open attachments nor follow links sent by e-Mail

James B. Byrne      
Harte & Lyne Limited
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3

Want to link to this message? Use this URL: <>