×
Create a new article
Write your page title here:
We currently have 3,189 articles on s23. Type your article name above or create one of the articles listed here!



    s23
    3,189Articles

    Fix broken Umlauts in Filenames: Difference between revisions

    Content added Content deleted
    imported>Took
    (Created page with "Not really optimized yet... [pre] #/bin/bash for d in * do if [ -d $d ]; then cd "$d" for i in * do #x=$(echo $i | sed 's/\xc2\x91\|\xc2\x92\|\xc2\xa0\|...")
     
    No edit summary
     
    Line 1: Line 1:
    rename.sh:
    Not really optimized yet...


    [pre]
    [pre]
    for i in *
    #/bin/bash
    for d in *
    do
    do
    x=$(echo $i | iconv -f utf8 -t ascii//TRANSLIT -c)
    if [ -d $d ]; then
    cd "$d"
    if [ "$i" != "$x" ];
    then
    for i in *
    echo "$i --TO-- $x"
    do
    #mv "$i" "$x"
    #x=$(echo $i | sed 's/\xc2\x91\|\xc2\x92\|\xc2\xa0\|\xe2\x80\x8e//g' | sed 's/ü/ue/g' | sed 's/[^a-z0-9_~\.-]/_/gi' )
    fi
    x=$(echo $i | iconv -f utf8 -t ascii//TRANSLIT -c)
    echo "$x"
    if [ -d "$x" ]; then
    mv "$i" "$x"
    cd "$x"
    done
    echo "cd to $x"
    /path/to/rename.sh
    cd ..
    cd ..
    fi
    fi

    Latest revision as of 20:40, 15 May 2013

    rename.sh:

    [pre] for i in *

     do
     x=$(echo $i | iconv -f utf8 -t ascii//TRANSLIT -c)
     if [ "$i" != "$x" ];
     then
       echo "$i --TO-- $x"
       #mv "$i" "$x"
     fi
     if [ -d "$x" ]; then
       cd "$x"
       echo "cd to $x"
       /path/to/rename.sh
       cd ..
     fi
    

    done [/pre]

    Cookies help us deliver our services. By using our services, you agree to our use of cookies.
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.