LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   pattern file with no return character (https://www.linuxquestions.org/questions/linux-newbie-8/pattern-file-with-no-return-character-271258/)

ksun 12-28-2004 03:34 PM

pattern file with no return character
 
I need to create a pattern file with no return or end of file characters for use with dt. I have seen it created before, I just don't remember what I saw 2 years ago.

Ideally, the file would be only the characters "0123456abcdefgh"

I first tried doing "echo 01234567abcdefgh > hex.pat" but I still ended up with something at the end.

I tried using dd to cut the file down by size, expecting that the end character would be cut off, but that didn't work. "dd if=hex.pat of=hex2.pat bs=1b"

So, I really just need a way to complete either of these successfully: create the pattern file without the invisible characters, or cut the invisible characters from the file.

If I recall correctly, the first way I saw that the file was the right size was when I did "cat hex.pat" the lack of a return character made the prompt get created after the hex pattern was put onscreen, rather than jumping to a new line. I don't know of another way to tell without looking at my dt output file.

Correct:

[root@localhost]# cat hex.pat
01234567abcdefgh[root@localhost]#

Incorrect:

[root@localhost]#cat hex.pat
01234567abcdefgh
[root@localhost]#

wapcaplet 12-28-2004 06:40 PM

I'm not quite sure what you're asking for (and I don't know what dt is), but how about:

Code:

echo -n "01234567abcdefgh" > hex.pat
The resulting file is exactly 16 bytes, with no newlines or anything in it.


All times are GMT -5. The time now is 10:27 PM.