When entering a directory on the command line:
ls -d -1 "/Volumes/Development/My Project/Project"* | grep \.png$
Prints a list of all files ending with .png .
However, when I try to create a script:
#! /bin/bash clear ; # Tempoary dir for processing mkdir /tmp/ScriptOutput/ ; wdir="/Volumes/Development/My Project/Project" ; echo "Working Dir: $wdir" ; # Get every .PNG file in the project for image in `ls -d -1 "$wdir"* | grep \.png$`; do ... done
I get an error message:
cp: /Volumes/Development/My: No such file or directory
space is causing a problem, but I don't know why?
source share