HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Expect scripting
Operating System - HP-UX
1828427
Members
3926
Online
109977
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
Forums
Discussions
Discussions
Discussions
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
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
01-24-2005 02:47 AM
01-24-2005 02:47 AM
I am trying to do some scripting with expect and I cannot figure out how to do what I need to do.
The problem is that I have a script that runs every day, but part of the input is the previous days date.
So what I need to do with expect is something like:
VAR1=$(caljd.sh -o $(caljd.sh -p 1))
send -- "${VAR1}\r"
How can I set a variable within expect to a value calculated by executing a shell command? I have searched high and low and I cannot figure out how to do that.
Thanks in advance!!!
The problem is that I have a script that runs every day, but part of the input is the previous days date.
So what I need to do with expect is something like:
VAR1=$(caljd.sh -o $(caljd.sh -p 1))
send -- "${VAR1}\r"
How can I set a variable within expect to a value calculated by executing a shell command? I have searched high and low and I cannot figure out how to do that.
Thanks in advance!!!
Solved! Go to Solution.
- Tags:
- expect
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2005 03:14 AM
01-24-2005 03:14 AM
Re: Expect scripting
Patrick,
would it be possible to use a temp file to read from??
Regards
would it be possible to use a temp file to read from??
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2005 03:56 AM
01-24-2005 03:56 AM
Solution
You use caljd.sh same way I do. Thanks for the concept validation.
Could you write this variable output to a file?
Then have the expect script source the file the same way users source .profile ... Just an out of the box concept.
SEP
Could you write this variable output to a file?
Then have the expect script source the file the same way users source .profile ... Just an out of the box concept.
SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
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
01-24-2005 06:24 AM
01-24-2005 06:24 AM
Re: Expect scripting
Thanks for the ideas guys. I did what you suggested.
I wrote a shell script that will generate the file with the dates I need, and the correct syntax for expect.
I then call my expect script from that shell script and source the file I created with the values I need.
This is much more elegant that what I was originally doing.
I wrote a shell script that will generate the file with the dates I need, and the correct syntax for expect.
I then call my expect script from that shell script and source the file I created with the values I need.
This is much more elegant that what I was originally doing.
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.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP