LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 12-28-2004, 03:34 PM   #1
ksun
Member
 
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.

Correct:

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

Incorrect:

[root@localhost]#cat hex.pat
01234567abcdefgh
[root@localhost]#
 
Old 12-28-2004, 06:40 PM   #2
wapcaplet
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:

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


Reply


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 06:17 AM
rename file with a pattern sujith_deva Programming 7 12-16-2004 07:39 PM
function won ' t return character array word Linh Programming 1 07-31-2003 06:11 PM
C can 't return a character array Linh Programming 5 06-18-2003 04:58 AM
Cannot pass and return a character array Linh Programming 1 06-12-2003 04:17 PM


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

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