[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: automated editing of text files



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Le 16/09/2011 23:40, Bob Proulx a écrit :
> If there are no *.txt files then the file glob won't be expanded,
> nothing to expand it to, and then your shell script will get a literal
> "*.txt" as an argument.  If that minor point is important to you then
> check that the file exists and simply break or continue if it does not.
> 
>   for i in *.txt; do
>     test -f "$i" || continue
>     ./add-pre-nl.sh "$i"
>   done

Simplest version :
	find -type f -name "*.txt" -exec add-pre-nl.sh {} \;


- -- 
Aeris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJOc8RvAAoJEK8zQvxDY4P9gbUH/2W5qTMILYW6ETTKKLnI+j2+
Ar5O8XhnnaQrTtLQgxzTiYfp0ErUL/pin8q/hYDh6bzDgnX4pog+6L+wJi/iV/Cx
Ob0tGvQQZjA2Y9oeTgkBRpxiiYKTohZK0cBYF8+Sf6w/+dLAF2lM3BygaRBkFcBM
4EuoOybM3GJq+jpsRyHiFCflOK+04yBzgSCyIL7awlviUchxFqVzwLpCaZe+FDSc
tSPBxL5UbP+LI+YfACiYHeJQmpnXGgeHj6Lkyxv7d1DLVRsjZRBt4jEDYCPjgPfW
UUO4NMKbH4adv1HnFUH72vB35G2aMuFylXd36Xx0Nozv+3LMWdtrCUK+Ois8pHM=
=lwDc
-----END PGP SIGNATURE-----


Reply to: