Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Oct 2020 14:37:55 -0600
From:      Bob Proulx <>
Subject:   Re: sh scripting question
Message-ID:  <>
In-Reply-To: <>
References:  <> <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
Kurt Hackenberg wrote:
> Bob Proulx wrote:
> > Oh you are tormenting us now.  :-)  There are some subtle issues here.
> Maybe a shell is the wrong tool.

And yet just the same the shell does handle whitespace and arbitrary
characters in file names easily.

    while IFS= read -r line; do
      printf "|%s|\n" "$line"
    done < file1

It's a shell programming idiom.  It accomplishes the task very easily.
For people programming in the shell every day this type of construct
rolls off the fingers like a native language.  But it may not be
immediately obvious without a hint that this is what is needed.

    Idiom, id-ee-uhm, noun. An expression conforming or appropriate to
    the peculiar structural form of a language.

Nothing we have seen yet makes the shell the wrong tool.  The shell is
a very powerful command and control language.  And so far the original
need was still for using it specifically as a command and control
language.  So all good so far!  If we move to needing complex data
structures however that is where my decision point is set to move to a
language that supports complex data types.

And I think everyone is in agreement that the filenames that were
chosen were not the file names that any Unix person would choose to
name their files.  No disagreement there.  I am sure they were chosen
by less enlightened individuals.  Given that the files on disk were
chosen for a different purpose then can we handle them easily in the
shell?  Yes.  So far nothing too difficult! :-)


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