- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: tr commad to change print escapes
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2005 03:22 AM
07-28-2005 03:22 AM
just changing invoice printing from HP to Sharp model -
Now I have to change printing skripts from
[esc]&l5H to [esc]&l4H. This is what I used: tr '&l5H' '&l4H'
this is not working, it distroyes my file2
can anyone help?
Thanks Barbara
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2005 03:24 AM
07-28-2005 03:24 AM
Re: tr commad to change print escapes
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2005 03:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2005 03:41 AM
07-28-2005 03:41 AM
Re: tr commad to change print escapes
I used tr "\ &l5H" "\ &l4H"
the escape sequense of
file1=&f5X &l5H (10U (s0p10.00h12.0v0s0b3T
file2=&f4X &l4H (10U (s0p10.00h12.0v0s0b3T
meaning it did not only change the &l5H, but also the preceeding &f4X &l4H , see above
Any other ideas?
Thanks again for helping
Barbara
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2005 03:47 AM
07-28-2005 03:47 AM
Re: tr commad to change print escapes
You need to use sed, awk, or Perl. Any of these can look for patterns (rather than individual characters) and take actions. I'm sure someone will post a solution but I choose not to because if you are going to use UNIX, you need to learn regular expressions. You should be able to find some very easy sed examples with just a little bit of searching.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2005 03:52 AM
07-28-2005 03:52 AM
Re: tr commad to change print escapes
thanks for you sed command. It worked very nicely!
since I am not so great on sed, could you also tell me, how to add an additional change? What I need to change is:
&l5H to &l4H and &l20H to &l22H
can that be done in one step, or do I have to use a tmpfile, like:
cat $1| sed -e "1,\$s/\&l5H/\&l4H/g" >tmp.prn
cat tmp.prn| sed -e "1,\$s/\&l20H/\&l22H/g"
thanks again
Barbara
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2005 04:20 AM
07-28-2005 04:20 AM
Re: tr commad to change print escapes
I agree being able to move around best way possible in a system. I did look up sed skripting and finished my job. Yet having Mel's answer is terrific, if one is really pressed for time.
Thanks to both of you !!
Barbara
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2005 04:22 AM
07-28-2005 04:22 AM
Re: tr commad to change print escapes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2005 04:24 AM
07-28-2005 04:24 AM
Re: tr commad to change print escapes
Quote:
_________________________________________
can that be done in one step, or do I have to use a tmpfile, like:
cat $1| sed -e "1,\$s/\&l5H/\&l4H/g" >tmp.prn
cat tmp.prn| sed -e "1,\$s/\&l20H/\&l22H/g"
_________________________________________
you can do it either way, i.e., the way you proposed in the quoted text above or
**********
cat $1| sed -e "1,\$s/\&l5H/\&l4H/g" | sed -e "1,\$s/\&l20H/\&l22H/g"
**********
(in case itrc breaks the line due to the new and improved forums code, all in between the two "**********" lines is actually a single line command)
multiple pipes are godsent and I missed them dearly when I was doing VMS sysadmin in a darker period of my career :)
UNIX because I majored in cryptology...