Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Znaki niedrukowane w nazwach plików
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Polskie forum (Polish) Polish OTW
View previous topic :: View next topic  
Author Message
molot
Apprentice
Apprentice


Joined: 26 Feb 2005
Posts: 214
Location: Warsaw, Poland

PostPosted: Wed Sep 14, 2011 10:25 am    Post subject: Znaki niedrukowane w nazwach plików Reply with quote

Hej

Pilnie potrzebuję wywalić niedrukowalne znaki z nazw plików, a przy tym zachować polskie litery. Nazwy plików są w utf-8.
Macie jakiś prosty sposób na to? Ja szukam od wczoraj rana, i właśnie się poddałem. Klasa [:print:] zdaje się nie obejmować naszych znaków, niestety, [a-z] też je pomija.
_________________
"I just have to run faster than the slowest party member"
Back to top
View user's profile Send private message
SlashBeast
Retired Dev
Retired Dev


Joined: 23 May 2006
Posts: 2922

PostPosted: Wed Sep 14, 2011 11:51 am    Post subject: Reply with quote

w baszu [a-z] zachowuje polskie znaki.

Code:
slashbeast@frontier ~ % bash
slashbeast@frontier ~ $ variable='łĄŁŚÐĄŁŚÐśąð²³¶¶đśðłąśðąśźżć'
slashbeast@frontier ~ $ echo $variable
łĄŁŚÐĄŁŚÐśąð²³¶¶đśðłąśðąśźżć
slashbeast@frontier ~ $ echo ${variable//[^a-zA-Z]}
łĄŁŚÐĄŁŚÐśąðđśðłąśðąść
Mogl bys to zalatwic jakims skryptem, parsujac output finda z separatorem na null character ustawionym.

Pozatym, uzywanie polskich znakow i spacji w nazwach plikow to proszenie sie o problemy.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Polskie forum (Polish) Polish OTW 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