Shell script help

Paul Smith paul at mad-scientist.net
Wed Oct 15 15:00:11 UTC 2014


On Wed, 2014-10-15 at 15:43 +0100, Colin Law wrote:
> for f in /some/path/$1/*.txt
> do
>   blah blah
> done

Just quote the variable:

  for f in /some/path/"$1"/*.txt; do
      blah blah
  done

Or the full path but not the glob:

  for f in "/some/path/$1"/*.txt; do
      blah blah
  done







More information about the ubuntu-users mailing list