- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: passing variable to connect direct
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-07-2002 01:00 PM
04-07-2002 01:00 PM
I posted this question last night but in the wrong area, so here goes again
I have a whole bunch of files in a directory that I need to submit using connect direct
I have created the following script to do this.
It works if I submit one file manually - However there is more than one file and having to past each file into the submit defeats the object
#!/usr/sbin/sh
cd $XELOGD/connectd
ls xeSnd* > $XELOGD/connectd/cube
CUBES=cube
for file in $(cat $CUBE)
do
export $file
echo 'submit file=/tmp/$file;' | direct | grep process >> /tmp/processid
done
The above bombs out with the message
XSQF009I Return Code: 8 Feedback: 2
:&FILENAME=/tmp/$file:&OSERR=2:
XAPI006I Return Code: 0 Feedback: 0
Specified file could not be opened.
Any help would be greatly appreciated
Thanks in advance
Steve
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2002 01:16 PM
04-07-2002 01:16 PM
Re: passing variable to connect direct
In this case however the error is in your script - replace:
echo 'submit file=/tmp/$file;' | direct | grep process >> /tmp/processid
with:
echo "submit file=/tmp/$file;" | direct | grep process >> /tmp/processid
The single quotes make everything inside them literal (no variable substitution), hence the error message. I seem to remember you should also use the '-x' flag when calling direct from the command line (but I can't remember why!)
echo "submit file=/tmp/$file;" | direct -x | grep process >> /tmp/processid
HTH
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2002 01:28 PM
04-07-2002 01:28 PM
Re: passing variable to connect direct
Nope, it doesn't work
$ echo $(cat $file)
xeSndCube_CC_C_
$ echo "submit file=/tmp/$file;" |direct -x
| grep process >> /tmp/process.out
XSQF009I Return Code: 8 Feedback: 2
:&FILENAME=/tmp/file:&OSERR=2:
XAPI006I Return Code: 0 Feedback: 0
Specified file could not be opened.
Regards
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2002 05:26 PM
04-07-2002 05:26 PM
Re: passing variable to connect direct
Have you replaced the HostName with
xeSndCube_CC_C_
If it is a literal, the shell is going to get confused by the '<', which normally is a redirection operator.
This should work:
xeSndCube_CC_C_\

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2002 05:55 PM
04-07-2002 05:55 PM
Re: passing variable to connect direct
I only used
Regards
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2002 05:58 PM
04-07-2002 05:58 PM
Re: passing variable to connect direct
The issue seems to be with the variable $file being passed to the connect direct session
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2002 06:51 PM
04-07-2002 06:51 PM
Re: passing variable to connect direct
for file in $(cat $CUBE) do echo "submit file=/tmp/$file;"
done >> ./myfile
Check that the contents of myfile are ok, and then run a
for myfile in $(cat ./myfile)
do
echo $myfile | direct | grep process >> /tmp/processid
done
Hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2002 07:45 PM
04-07-2002 07:45 PM
Re: passing variable to connect direct
Thanks for the reply, still getting the errors, a little different this time though
XPAE003I Return Code: 8 Feedback: 0
:&KEYWD=file:
XPAM001I Return Code: 8 Feedback: 0
Errors Parsing
Cheers
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2002 08:01 PM
04-07-2002 08:01 PM
Re: passing variable to connect direct

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2002 08:05 PM
04-07-2002 08:05 PM
Re: passing variable to connect direct
myfile is fine
submit file=/tmp/xeSndCube_CC_C_SI***W3.26774;
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2002 08:40 PM
04-07-2002 08:40 PM
Re: passing variable to connect direct
Are you sure it's "submit file"? Should it be, perhaps, "submitfile" or "submit_file"?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2002 08:45 PM
04-07-2002 08:45 PM
Re: passing variable to connect direct
nah man
The command is used with connect direct shell
heres what it looks like when you enter direct from the from prompt
******************************************************
* *
* CONNECT:DirectUNIX *
* *
*----------------------------------------------------*
* Copyright (c) 1983, 2000 Sterling Commerce, Inc. *
* Version 3.3.03 *
******************************************************
Enter a ';' at the end of a command to submit it. Type 'quit;' to exit CLI.
Direct>
I use the submit command for each file that requires sending.
I'm off home now 06:00 in the UK and not back till Friday , I'm determined to get to the bottom of this. I will check for any replies When I get up this afternoon
Thanks very much for your help
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2002 10:00 PM
04-07-2002 10:00 PM
SolutionIf you want to use the interactive CLI interface, maybe the best way to go about it would be to use "expect".
http://hpux.connect.org.uk/hppd/hpux/Tcl/expect-5.31/

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2002 01:02 AM
04-10-2002 01:02 AM
Re: passing variable to connect direct
I'm not back in the office till Friday to test this further, but was wondering if anyone had any further input regarding this question
Regards
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2002 03:46 PM
04-10-2002 03:46 PM
Re: passing variable to connect direct
I am not familiar with connect direct but just a thought, did you try running in debug mode and see what value is being passed when you do a submit
1) ksh -x scriptname
2) Also try putting double quotes around /tmp/"$file"
Let us know after you get back ...
Thanks,
Shabu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2002 01:38 AM
04-14-2002 01:38 AM
Re: passing variable to connect direct
I removed the export $file from the script, it now looks like
#!/usr/bin/sh
clear
if [ $LOGNAME != dssadmin ]
then
echo "\n\tYou must be dssadmin user to run this script!!!!"
sleep 5
exit
fi
> $XELOGD/connectd/records.log
cd $XELOGD/connectd
ls xeSnd* > $XELOGD/connectd/sendem.log
sendit=$XELOGD/connectd/sendem.log
for file in $(cat $sendit)
do
ls $file >> $XELOGD/connectd/cubes.log
done
CUBES=$XELOGD/connectd/cubes.log
for files in $(cat $CUBES)
do
echo "submit file=/tmp/$files;" | direct -x >> $XELOGD/connectd/processid.log 2>
> $XELOGD/connectd/errors.log
done
clear
Thanks for your help
Steve