[Qgis-user] help to list files by bourne-shell

Donovan Cameron sault.don at gmail.com
Wed Jun 20 13:45:07 PDT 2012


You can also try it with a simple test:

*
for i in C:/Users/tappenbeck/Desktop/Project/*
do [ -d "$i" ] && echo "$i" is directory
done*


Notice that because it is in a shell script and is broken into separate
lines already, the semi-colons ";" have been removed.

You only need semicolons when placing it in one line, like copy and pasting
into a terminal instead of running from a script.




Take your pick =)



Donovan

On Wed, Jun 20, 2012 at 12:51 PM, <pcreso at pcreso.com> wrote:

> Hi Jan
>
>
> for i in C:/Users/tappenbeck/Desktop/Project/*;
>
> change to :
>
> for l in `ls C:/Users/tappenbeck/Desktop/Project/` ;
>
>
> enclosing a comand in back quotes will return the result of the command, &
> you want to return a list iof the contents of the folder, not the string
> which is the folder name.
>
>
> --- On *Thu, 6/21/12, Jan Tappenbeck <osm at tappenbeck.net>* wrote:
>
>
> From: Jan Tappenbeck <osm at tappenbeck.net>
> Subject: [Qgis-user] help to list files by bourne-shell
> To: "qgis-mailingliste" <qgis-user at lists.osgeo.org>
> Date: Thursday, June 21, 2012, 2:36 AM
>
>
> hi !
>
> i want to create a script for use in msys - but i am not a linux-user. i
> try to create this by a template:
>
> #!/bin/sh
> # Einfaches Beispiel
>
> for i in C:/Users/tappenbeck/Desktop/Project/*;
> do
> if [ -d "$i" ];
> then
> echo $i is directory;
> fi;
> done
>
> but there will no files list - can anyone help me ?
>
> reagards Jan :-)
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org <http://mc/compose?to=Qgis-user@lists.osgeo.org>
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20120620/490e2a62/attachment.html>


More information about the Qgis-user mailing list