Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- last=split($0,str,"/");
- split($0,old,"/");
- new="";
- for(i=0;i<=last;i++){
- sub(/ě/, "e", str[i]);
- sub(/š/, "s", str[i]);
- sub(/č/, "c", str[i]);
- sub(/ř/, "r", str[i]);
- sub(/ž/, "z", str[i]);
- sub(/ý/, "y", str[i]);
- sub(/á/, "a", str[i]);
- sub(/í/, "i", str[i]);
- sub(/é/, "e", str[i]);
- new=new"" str[i];
- if(i!=last&&i!=0)
- new=new "/";
- }
- old_cmd="";
- for(i=0;i<last;i++){
- old_cmd=old_cmd "" str[i];
- if(i!=0)
- old_cmd=old_cmd "/";
- }
- old_cmd=old_cmd "" old[i];
- if(new!=old_cmd){
- printf("rozdil ");
- cmd="";
- cmd="mv " old_cmd " " new;
- printf("%s\n",cmd);
- system(cmd);
- }
- }
Add Comment
Please, Sign In to add comment