Afficher un message
Vieux 28/05/2007, 03h12   #1
Dave Kelly
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Using basename to strip suffix

I am trying to strip the suffix 'jpg' from a list of images. I keep
getting this error.

../writeimage: line 23: and this is what you catch.jpg: command not found
../writeimage: line 23: dave-damon-2006-3.jpg: command not found
../writeimage: line 23: Double exposure.jpg: command not found

Here is a snippet containing the error producing code.

for filename in *.jpg; ##list images in directory

do
if [ -f "$filename" ]
then

CAPTION=basename "$filename" .jpg

imageline="
<td align=\"center\"> <p style=\"margin-top: 0; margin-bottom: 0\"> <img
border=\"0\" src=\"$filename\"></a></p> <p style=\"margin-top: 0;
margin-bottom: 0\">"$CAPTION"</p> </td>"

This is a maintance tool for me. I run it on my debian based machine.

TIA
Dave

--
A little rum in the morning coffee. Just to clear the cobwebs, ya know.
  Réponse avec citation
 
Page generated in 0,05014 seconds with 9 queries