Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Here I will use iconv to convert your file to what I found with "locate 8859". For a real example, the characters in a file should make up actual works with accents, or foreign characters. You should be able to tell if you used the right one by examination. Posting a few sample lines of an actual file would have been more useful.
I hope we don't confuse the LQ server with all of these strange characters! Just glancing at the results you can see which one supports cyrillic. The documentation for codepages should tell you what locales they are for.
is much more compact than the 96 lines above. The trick is getting the correct number of backslashes. Depending on how the 96 lines are written/generated, it may also be more accurate.
Empirically. -- I just kept doubling the the number of backslashes until the code worked.
If you need a literal '\' to appear in a context like this, you escape it w/ itself: '\\'. Sometimes, like here, that isn't enough, there is a 2nd layer of escaping necessary. Then '\\\\' (which becomes '\\', which becomes '\') is used.
I didn't bother to figure out why 4 is the right number of them to use. I just stopped when I knew I had the right answer.
I knew to try this mainly from reading the gawk documentation.
Well, really it just shows that echo interprets \ by default. First, \\\\ stands without protection in the middle of a command. So it gets collided simultaneously with deciding that
"a\ b" is one word. Now inner echo invocation gets an argument starting with '\\x' . By default echo interprets \-sequences, so the command in `` outputs something beginning with '\x' . Now it gets fed to outer echo, and is used as a hex number starter.
Well, really it just shows that echo interprets \ by default. First, \\\\ stands without protection in the middle of a command. So it gets collided simultaneously with deciding that
"a\ b" is one word. Now inner echo invocation gets an argument starting with '\\x' . By default echo interprets \-sequences, so the command in `` outputs something beginning with '\x' . Now it gets fed to outer echo, and is used as a hex number starter.
But where do all these spaces between letters come from?
And what should be modified to get rid of them?
2 coding (as in programming) comments, both involving the use of bash brace expansion:
Code:
for code in $(seq 1 9) 13 14 15
for code in {1..9} 13 14 15
for code in {{1..9},{13..15}}
all do the same thing, the brace expansions are both shorter. The "hybrid" is the shortest -- brace expansion is not the answer to everything.
Thanks for that. I had forgot about it. I'll routinely use the {a,b,c} form of brace expansion but using a range hadn't sunk into my brain enough to remember is.
---
Wikipedia has some good articles about the iso8859 standard. Some of the \xA0-\xFF values are not used so the sample file we used should be adjusted.
I don't know how to 'fold' posts on this forum, or how to delete them.
Hopefully though, this will be more acceptable:
Code:
$ export FILTER=$(/usr/bin/time -f '%e seconds' ../gen_filter.sh)
18.69 seconds
$ ls -l
total 0
-rw-r--r-- 1 john john 0 2009-06-03 16:01 ËÔ
-rw-r--r-- 1 john john 0 2009-06-03 16:01 α
-rw-r--r-- 1 john john 0 2009-06-03 16:01 αβγδεζηθικλμνξοπρςστυφχψω
-rw-r--r-- 1 john john 0 2009-06-03 16:01 γδεξοπζηθιωαβ-ËÔ
-rw-r--r-- 1 john john 0 2009-06-03 16:01 δεξο νξ-ËÔ γδε
-rw-r--r-- 1 john john 0 2009-06-03 16:01 εξοπ.ωαβ
-rw-r--r-- 1 john john 0 2009-06-03 16:01 λμνξ-ËÔ
$ /usr/bin/time -f "%e seconds" ../rename.sh
0.15 seconds
$ ls -l
total 0
-rw-r--r-- 1 john john 0 2009-06-03 16:01 a
-rw-r--r-- 1 john john 0 2009-06-03 16:01 abgdeze_iklmnxoprsstyfk_o
-rw-r--r-- 1 john john 0 2009-06-03 16:01 dexo nx-EO gde
-rw-r--r-- 1 john john 0 2009-06-03 16:01 EO
-rw-r--r-- 1 john john 0 2009-06-03 16:01 exop.oab
-rw-r--r-- 1 john john 0 2009-06-03 16:01 gdexopze_ioab-EO
-rw-r--r-- 1 john john 0 2009-06-03 16:01 lmnx-EO
Last edited by SwaJime; 06-03-2009 at 05:17 PM.
Reason: attempting compliance with folding request
Please edit your posts to fold your extra long code blocks
-- they are causing the worst horizontal scrolling
in Konqueror 3.5.8 that I have ever seen.
If you don't, the only way I can continue
to participate in this thread
is to put you on my ignore list.
<original reaponse>
Thank you, SwaJime, for making this thread unreadable in Konqueror 3.5.8 w/ your extra long code/quote blocks. I can fix this problem in several ways:
unsubscribe
use Firefox
use Opera
put you on my ignore list
hope you edit your posts to eliminate the horizontal scrolling they currently trigger
Guess which I am most likely to do?
</original reaponse>
Please edit your posts to fold your extra long code blocks
-- they are causing the worst horizontal scrolling
in Konqueror 3.5.8 that I have ever seen.
If you don't, the only way I can continue
to participate in this thread
is to put you on my ignore list.
[ COLOR="#E6E6E6" ]
< original reaponse >
Thank you, SwaJime, for making this thread unreadable in Konqueror 3.5.8 w/ your extra long code/quote blocks. I can fix this problem in several ways:
unsubscribe
use Firefox
use Opera
put you on my ignore list
hope you edit your posts to eliminate the horizontal scrolling they currently trigger
Guess which I am most likely to do?
< /original reaponse >"
[ /COLOR ]
Toad,
Thank you so much for your warm welcoming hospitality.
I finally, completely accidentally, stumbled upon some information regarding this "folding" that you've so kindly suggested.
I probably won't spend much time posting to any part of this forum in the future, given the gratefulness and appreciation that has been shown to me here so far for my contributions.
I was pleased to note also that the horizontal scrolling "issue" that I am somehow responsible for seems to afflict other posts in this thread, and yet there was apparently some redeeming quality of those that kept you from giving them such helpful advice.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.