Tag Info

New answers tagged

0

I might try extracting the data files after booting back to windows using windows tar. If tar omitted some files while you were creating the archive, it probably would have given some error messages. Also, you can list the contents of a tar file with: tar tvf tarfile.tar.gz


1

Let less handle the problem, as it's good at it. The pager less is pretty good at formating binary files for output. Also, the pager features, like scrollback and searching are often useful. It has no direct option for following a file that grows, but it has way to provide keystrokes to "type" after startup. The key F starts following the growing file, ...


6

You can translate special characters (binary data) into ordinary characters that are safe to display by piping your tail command into cat -v: tail --follow=name my-rolling-file.log | cat -v The -v (verbose) option of cat (also known as --show-nonprinting) displays "nonprinting" characters using the ^ and M- notations: 0x00 is displayed as ^@ 0x01 is ...


3

Convert (some troublesome) characters to . with tr: tail -f data | tr "\000-\011\013-\037\177-\377" "."


4

What about this, tail --follow=name my-rolling-file.log | strings The default for strings is that it will only output printable characters in lengths of 4 (or more), but you can change this with -n {number}.


0

If you want the output value of a command or function to be assigned use this syntax: x=$(ord "$car") var=$(chr "$x") (The errors you've got because the syntax you used, e.g. x=ord $car, will do the following: the variable x will get assigned the string "ord", and the variable x then made available to the environment of the subsequent command $car; but ...


24

That's a really nice catch. From a quick look at the source code for GNU find, I would say this boils down to how fnmatch behaves on invalid byte sequences (pred_name_common in pred.c): b = fnmatch (str, base, flags) == 0; (...) return b; This code tests the return value of fnmatch for equality with 0, but does not check for errors; this results in any ...


13

find -name option uses shell pattern matching notation to perform matching filename. * is a pattern matching multiple characters, shall match a string of zero or more characters. find uses fnmatch to check pattern matching, so you can use ltrace to check the result: $ touch $'\U1212'aa $ touch D$'\351'sinstaller $ LC_ALL=en_US.utf8 ltrace -e fnmatch find ...


1

Those characters actually do not exist in those three encodings. You actually want EUC-JIS-2004 aka EUC-JISX0213 instead of plain EUC-JP, SHIFT_JIS-2004 or CP932 instead of SHIFT_JIS, and ISO-2022-JP-2004 instead of plain ISO-2022-JP. % printf "\xad\xa1\xad\xa2\xad\xa3 \xad\xa4\xad\xa5\xad\xa6\xad\xa7\xad\xa8\xad\xa9" | iconv -f euc-jisx0213 -t utf-8 ①②③ ...


0

What you wrote tests whether the value of the variable TEXT contains at least one ASCII character. If you want to test whether $TEXT contains non-ASCII characters, you need to invert the set. By the way, [:ascii:] is locale-independent, so you don't need to set LC_CTYPE. if [[ $TEXT = *[![:ascii:]]* ]] then echo "Contain Non-ASCII" fi Note that ...


0

TEXT=SOMETEXTHERE RESULT=$(echo $TEXT | LC_COLLATE=C grep -r '[^ -~]') if [ -z "$RESULT" ]; then echo "ALL ASCII" else echo "Contain Non-ASCII" fi


1

The simplest solution I was able to find for removing "non-ascii" characters from a text file was from this thread. $ tr -cd '\000-\777' < dirtyfile > cleanfile The '\000-\777' defines the ascii set in octal. "-c" is the compliment of the given set, aka "non-ascii" and "-d" deletes characters.


0

You can just use luit. It's purpose is to clean terminal text to suit the system's encoding and to act as a transparent filter between a applications which improperly handle unicode and terminals - or the other way around. You almost definitely already have it installed - it ships standard with X because xterm calls on it automatically if it detects ...


1

ASCII is a 7-bit character set. Characters with values above 128 are non-ASCII characters. If you use Unicode, note that a character is represented by multiple bytes (there are only 256 different byte values but more than 100000 Unicode characters). The de facto standard representation of Unicode is UTF-8 uses a variable number of bytes per character; ASCII ...


3

-????????? ? ? ? ? ? 웹.collection This kind of output from ls -l indicates that it was able to read a file name in the directory, but it was not able to access the corresponding inode. The inode contains all the information about a file (type, permissions, timestamps, etc., as well as the location of the contents) except for the name ...


1

The source characters look like it may be ATARI. Try -f ATARI or -f ATARIST


1

The codes hex:<9a> and hex:<83> are not ASCII codes (ASCII codes go only from <00> to <7F>). You also cannot "find out" what characters (from any larger character set than ASCII) are associated with those codes since that depends on the underlying character set ("code page") encoding. So you have to ask the one who created that data what ...



Top 50 recent answers are included