Guest User

Untitled

a guest
Apr 8th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Awk 0.63 KB | None | 0 0
  1.     {
  2.     last=split($0,str,"/");
  3.     split($0,old,"/");
  4.     new="";
  5.     for(i=0;i<=last;i++){
  6.     sub(/ě/, "e", str[i]);
  7.     sub(/š/, "s", str[i]);
  8.     sub(/č/, "c", str[i]);
  9.     sub(/ř/, "r", str[i]);
  10.     sub(/ž/, "z", str[i]);
  11.     sub(/ý/, "y", str[i]);
  12.     sub(/á/, "a", str[i]);
  13.     sub(/í/, "i", str[i]);
  14.     sub(/é/, "e", str[i]);
  15.     new=new"" str[i];
  16.     if(i!=last&&i!=0)
  17.      new=new "/";
  18.     }
  19.     old_cmd="";
  20.     for(i=0;i<last;i++){
  21.     old_cmd=old_cmd "" str[i];
  22.     if(i!=0)
  23.      old_cmd=old_cmd "/";
  24.     }
  25.  
  26.     old_cmd=old_cmd "" old[i];
  27.  
  28.     if(new!=old_cmd){
  29.         printf("rozdil ");
  30.  
  31.     cmd="";
  32.     cmd="mv " old_cmd " " new;
  33.     printf("%s\n",cmd);
  34.     system(cmd);
  35.     }
  36.  
  37.  
  38.     }
Add Comment
Please, Sign In to add comment