Re: Wie kann ich einfach Dateinamen überprüfe n

Nelson Matias <[email protected]>
Newsgroups spline.fli4l.geschnatter
Organization spline
Message-ID <[email protected]>
Hallo Marcus,

am 20.05.2025 um 22:36 schrieb Marcus Röckrath:
>>> Da / auch im String vorkommt, nimm als Trenner was anderes, z. B.:
>>>
>>>     -e s#[!"$'*/:;<>?@\´`^°|]#_#g
>>
>> Hier könnte man auch tr bemühen:
>>
>> tr "[]\!$*/:;<>?@^°|\"\`\´\'" "_"
> 
> oder mal positiver angehen, also nach Erlaubtem suchen und das durchlassen:
> 
> #!/bin/sh
> 
> input="$1"
> output=""
> 
> for i in $(seq 0 $((${#input}-1)))
> do
>      if echo ${input:$i:1} | grep -Eq "[+-_.,#~(){}§%[:alnum:]]"
>      then
>          output=${output}${input:$i:1}
>      else
>          output=${output}"_"
>      fi
> done
> echo ${input}
> echo ${output}

ja das hab ich in dieser Art gelöst. Weil ich feststellen musste, das 
manche Geschichten auch ganz andere Zeichen im Titel verwendet haben. 
Kommt in Windows gar nicht gut wenn plötzlich chinesische oder 
japanische Zeichen vorkommen.

Danke für die Hilfe!

-- 
Gruß
Nelson
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.