- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Manipulation of variables
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
04-28-2003 07:45 AM
04-28-2003 07:45 AM
I have the MYVAR variable with the following content:
#echo $MYVAR
REPORT`date +%d%m%y`.txt
So, I need use this content with the date resolution (REPORT280403.txt), Some idea about this?
Regards
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2003 08:04 AM
04-28-2003 08:04 AM
Re: Manipulation of variables
If I understand what you are asking, you want the REPORT variable to have the 'date' construct in it? I'm not sure you can do that. I would suggest setting the date in a variable and then substituting that value into the REPORT variable, something like this:
MYDATE=$(date +%d%m%y)
MYVAR=REPORT${MYDATE}.txt
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2003 08:06 AM
04-28-2003 08:06 AM
Re: Manipulation of variables
LOGFILE=/tmp/oas/forms6i_${TIMESTAMP}.log
Real life example.
This is how we track forms server startups.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2003 08:28 AM
04-28-2003 08:28 AM
Re: Manipulation of variables
tdate=`date +%d%m%y`
myvar=REPORT${tdate}.txt
echo "Filename : $myvar "
Filename : REPORT280403.txt
Thanks
Zafar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2003 08:35 AM
04-28-2003 08:35 AM
Re: Manipulation of variables
None answer is useful for me.
Simply imagine that I have the variable with that content, but I need to use the resultant of the execution of the contained command in it.
I read this content (REPORT`date +%d%m%y`.txt)from a plain file, then I will try to use it in the following final command:
uuenconde source.txt $MYVAR|mailx -s Test user@domain
When I try this way the following message appear: Usage: uuencode [ source ] remotedest
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2003 09:42 AM
04-28-2003 09:42 AM
Re: Manipulation of variables
uuenconde source.txt `eval $MYVAR` | mailx -s Test user@domain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2003 09:50 AM
04-28-2003 09:50 AM
Re: Manipulation of variables
Just copy and test it:
uuenconde source.txt ${MYVAR}|mailx -s Test user@domain
Thanks
Zafar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2003 09:51 AM
04-28-2003 09:51 AM
Re: Manipulation of variables
Regrettably it has not worked!
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2003 09:55 AM
04-28-2003 09:55 AM
Re: Manipulation of variables
I have attempted your recommendation before obtaining into the outgoing email body:
Usage: uuencode [ source ] remotedest
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2003 10:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2003 04:30 AM
04-29-2003 04:30 AM
Re: Manipulation of variables
KSH,Bourne,...:
eval MYVAR=$MYVAR
TCSH,...:
eval set MYVAR=$MYVAR
If you do need the old setting of MYVAR futher on, take another variable.