- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Managing variables -very important
Operating System - HP-UX
1748157
Members
4057
Online
108758
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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-07-2009 11:38 PM
тАО10-07-2009 11:38 PM
Re: Managing variables -very important
>MK: If your variable contains semi-colons and the variable expansion is not quoted, the first semi-colon will terminate the echo command
Not hardly, a real shell doesn't look for a ";" after variable expansion:
$ x="abc;def"
$ echo $x
abc;def
The reason you quote things is because you want to preserve the whitespace.
Not hardly, a real shell doesn't look for a ";" after variable expansion:
$ x="abc;def"
$ echo $x
abc;def
The reason you quote things is because you want to preserve the whitespace.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-07-2009 11:41 PM
тАО10-07-2009 11:41 PM
Re: Managing variables -very important
>echo "${TAP OUT}" > file02.txt
You can't do that. You can't have spaces in a variable name. You would get:
ksh: "${TAP OUT}": bad substitution
You can't do that. You can't have spaces in a variable name. You would get:
ksh: "${TAP OUT}": bad substitution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2009 12:11 AM
тАО10-08-2009 12:11 AM
Re: Managing variables -very important
when i substitute with the following
x="TAP OUT"
echo $x > file02.txt;
i received the e-mail contaning "TAP OUT" as the body!!
i need to subistitue with the variable value
ie $TAP OUT not the name char "tap out"
shall i do it like
x="${TAP OUT}"
echo $x.........
?
plz advise
x="TAP OUT"
echo $x > file02.txt;
i received the e-mail contaning "TAP OUT" as the body!!
i need to subistitue with the variable value
ie $TAP OUT not the name char "tap out"
shall i do it like
x="${TAP OUT}"
echo $x.........
?
plz advise
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2009 12:27 AM
тАО10-08-2009 12:27 AM
Re: Managing variables -very important
>I need to substitute with the variable value
ie $TAP OUT not the name char "tap out"
You can't have a variable with embedded spaces.
If you want to do variable "indirection":
$ x=9
$ y=10
$ z=x
$ eval echo \$$z
9
ie $TAP OUT not the name char "tap out"
You can't have a variable with embedded spaces.
If you want to do variable "indirection":
$ x=9
$ y=10
$ z=x
$ eval echo \$$z
9
- « Previous
-
- 1
- 2
- Next »
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP