Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
script awk (o bash) per rinominare file con spazi[risolto]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
manang
Apprentice
Apprentice


Joined: 09 Oct 2006
Posts: 245

PostPosted: Sun Dec 14, 2008 11:50 pm    Post subject: script awk (o bash) per rinominare file con spazi[risolto] Reply with quote

salve, ho realizzato un banale scipt in awk che mi rinomina i file.
il problema è che se ci sono spazi nel nome destinazione lo script non va.
cosa posso fare?
esiste qualche soluzione?
grazie mille.
Code:

#!/usr/bin/awk -f
BEGIN{
  FS="  ";
}
{
a="cp "$1"" '"$2"'";
system(a);
}

io ho provato con cp per rinominare, perchè non volevo distruggere le sorgenti, visto che sto riprovando e riprovando, ma cambiare comando non è un problema

edit:
ho risolto aggiungendo gli apici acuti alla stirnga a (a me interessava gli spazi in $2
ciao
angelo
_________________
manang
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum