Register
It is currently Tue Dec 12, 2017 11:46 am

_0__ != _0__ ???


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Wed Jul 01, 2015 6:19 am   

Joined: Wed Jul 01, 2015 6:08 am
Posts: 2
Hi!

New here. Working with linux servers for a very long time, but never needed help (besides man and google) until now. The thing that happens is very odd.

I use rsync and have a grep appended:

Code:
rsync ... --out-format=..._%b__ | grep -v '_0__'


I would expect it to filter every line with 0 bytes transfer length (no sync needed). It does this about 99% of the time. Some times not...

All not working cases have umlauts. Example: .../Zweibru?\#210cken/_0__

If I copy the line from the terminal and put it into a file and then cat this file and do the same grep it is working.

Anybody an idea how to make this grep working for every file or for a place where I can find a description how this umlaut stuff is handled?

Thank you very much in advance!

Kind regards,
Anton


Top
 Profile  
 PostPosted: Wed Jul 01, 2015 8:14 am   

Joined: Mon Oct 20, 2014 9:53 am
Posts: 560
A very strange thing.
I guess these names stem from a system that is not using UTF-9 for file name encoding.

The very strange representation of the "ü" does not comply with any char table known to me.
The posted numerical representation should give a "Ò"
And it is not a XML entity too.

rsync and rsyncd(.conf) can use env var RSYNC_ICONV or --iconv option.
Try to figure out how to get the file names properly.
Use iconv --list to see a list of tables that can be properly converted and adjust rsync command appropriate.

grep can stumble upon umlauts too. An "Ä" is interpreted as a horizontal tab on some systems.
You can try a sed -rn 's/.*_(0)__.*$/\1/p' to print just the zero.


Top
 Profile  
 PostPosted: Mon Jan 18, 2016 1:59 pm   

Joined: Wed Jul 01, 2015 6:08 am
Posts: 2
TNX, will try it. Sorry for the late response, this task was on the end of a very long TODO list :D


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 26 guests


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 post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP