Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading line format characters in /etc/printcap 1

Status
Not open for further replies.

gawker

Programmer
Feb 21, 2002
34
US
Greetings All.

Using a shell script and awk, I am trying to do a locate/compare certain information contained in the /etc/printcap file on a LINUX system.

The file is specially formated, so I cannot search for " :" (colon with leading blank) as what appears to be leading blanks on the line is actually something else.

lp0: :sd=/var/spool/lpd/lp0: :mx#0: :sh: :lp=:

This "something else" looks like "^I" when in vi (01) Esc 02) : and 03) set list):

lp0:\$
^I:sd=/var/spool/lpd/lp0:\$
^I:mx#0:\$
^I:sh:\$
^I:lp=:$

Is there a way to test for whatever line control is present so that I can do data-checking (substr, index, etc) which includes the special characters/controls?

Thank you.

[penguin] gawker
 
Hi gawker-

A control I (^I) is a tab. You can use octal code 011 in your substr.....thus: /\011/

HTH


flogrr
flogr@yahoo.com

 
Thanks flogrr,

That is exactly what I was looking for.

gawker
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top