- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: echo and backslash characters
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
10-11-2002 08:20 AM
10-11-2002 08:20 AM
I'm writing a ksh script with the following line:
echo $ATTLINE >> $TEMPFILENAME
The variable $ATTLINE contains a string of characters which can include consequtive backslash characters i.e. \
The echo command sees the \\ as an escape sequence and I lose one of the backslash characters thus corrupting my file.
Is there a way of stopping echo from doing this ? or are there any other commands I can use to append the variable to the file without losing characters ?
Thanks,
Adrian.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 08:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 09:37 AM
10-11-2002 09:37 AM
Re: echo and backslash characters
How do you assign the value of ATTLINE ?? Maybe you can correct the issue there?
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 09:47 AM
10-11-2002 09:47 AM
Re: echo and backslash characters
One option is to use the octal equivalent \0134 for the backslash.
e.g.
ATTLINE="\0134\0134Yes\0134"
echo "${ATTLINE}"
P.S. The backslashes may be silently swallowed by the
Webserver engine so each of the 0134's should be preceded by a backslash character.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 11:32 AM
10-11-2002 11:32 AM
Re: echo and backslash characters
Thanks for the replies.
The ATTLINE variable is being read from a file so I can't control what characters it contains.
However, Rod's suggestion worked !
Many thanks,
Adrian.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 11:37 AM
10-11-2002 11:37 AM
Re: echo and backslash characters
cat ${ATTFILE} >> ${TEMPFILENAME}
there is no need for echo at all.