Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This 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!


  Search this Thread
Old 12-28-2004, 04:34 PM   #1
Registered: Sep 2003
Posts: 52

Rep: Reputation: 15
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.


[root@localhost]# cat hex.pat


[root@localhost]#cat hex.pat
Old 12-28-2004, 07:40 PM   #2
LQ Guru
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

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

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
printing pattern match and not whole line that matches pattern Avatar33 Programming 13 05-06-2009 07:17 AM
rename file with a pattern sujith_deva Programming 7 12-16-2004 08:39 PM
function won ' t return character array word Linh Programming 1 07-31-2003 07:11 PM
C can 't return a character array Linh Programming 5 06-18-2003 05:58 AM
Cannot pass and return a character array Linh Programming 1 06-12-2003 05:17 PM > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration