- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Batch Job Submission Script
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
02-13-2006 10:28 AM
02-13-2006 10:28 AM
Batch Job Submission Script
We are relatively new to Unix and Unix scripting but are quickly gaining experience with posix and perl.
Need to convert batch jobs from Streamx (Vesoft).
Has anyone developed a good method for this?
Basically, Streamx prompts for variables that are then utilized within the batch job by way of code replacement just prior to launch.
Very basic example:
::echo Launching Example Job.
::read testvar?"Enter Variable ? "
!job testjob
!testcmd {testvar}
!eoj
** end of example **
:: commands are executed prior to launch.
! commands are executed post launch.
(note: some commands were changed to unix work-alike commands in example above.)
We have tested using Perl and Posix scripting with pros and cons for each.
We are considering developing a full application system to hopefully provide more functionality but this would be a more lengthy conversion.
Any ideas or suggestions would be appreciated.
- Tags:
- crontab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2006 10:33 AM
02-13-2006 10:33 AM
Re: Batch Job Submission Script
You might find expect scripting is useful to you.
http://hpux.connect.org.uk/hppd/hpux/Tcl/expect-5.43/
SEP
Help I keep posting when I should be asleep.
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Tags:
- expect
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2006 10:45 AM
02-13-2006 10:45 AM
Re: Batch Job Submission Script
In the absence of details, at first blush, either would suffice nicely.
If you are comfortable using perl, I would certainly consider building your job streams with it; *particularly* if you are considering developing a full applications system as you note.
The advantage gained, depending upon the complexity of your command parsing, would be that perl can handle matching, extracting and substituting pieces of parsed data in a more simple, elegant way than pure shell or shell blended with 'awk' or 'sed'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2006 07:11 PM
02-13-2006 07:11 PM
Re: Batch Job Submission Script
command <<-EOF
..
EOF
syntax. Or piping as,
(
echo "inputr"
sleep 1
echo "input"
sleep 1
) | command.
It is suitable to normal application. We can not use these tricks with secured things like ssh, su. We can use expect scripting in that stage. I hope you are requirement is falling with this 3rd of expect scripting.
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2006 07:28 PM
02-13-2006 07:28 PM
Re: Batch Job Submission Script
As suggested, expect scripting will be the easiest of all. Perl is a very good, flexible scripting language in Unix and windows as well.
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2006 08:55 AM
02-14-2006 08:55 AM
Re: Batch Job Submission Script
I've been reading up on Expect and it appears to be a utility for automating responses to interactive prompts, among other things.
This is not my goal. I want the user to respond to all prompts. However, I want those responses to then be available to the batch job launched subsequent to the prompts.
Could I perhaps (reference basic example in the thread header):
1) grep the '::' lines into filea for execution as a normal posix shell script, after removing '::' from the front of each line.
2) editor-like line change commands could be added and echo'd to fileb after each interactive prompt and successful response.
(echo change '{var1}' to '$var1' all >>fileb )
3) grep all lines without '::' into filec.
4) run fileb against filec using editor making global changes to replace {vars} with the actual responses.
5) launch filec.
Does this make sense?
Blair
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2006 09:11 AM
02-14-2006 09:11 AM
Re: Batch Job Submission Script
#!/usr/bin/perl
use strict;
use diagnostics;
print "Enter response:";
my $response=
system("batchjob $response");
hope this is what you are looking for
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2006 08:27 PM
02-14-2006 08:27 PM
Re: Batch Job Submission Script
basically you ahve to change from:
::echo Launching Example Job.
::read testvar?"Enter Variable ? "
!job testjob
!testcmd {testvar}
!eoj
to:
echo Launching Example Job.
read testvar?"Enter Variable ? "
noput testcmd testvar &
so I'd use:
sed 's/:://g;/!job/d;/!eoj/d;s/^!/nohup /;/nohup/ s/$/ \&/'
to obtain this.
HTH,
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2006 08:46 PM
02-14-2006 08:46 PM
Re: Batch Job Submission Script
#!/bin/sh
# scriptname: dojob1
echo "Launch Example"
read testvar?"Enter variable: "
export testvar
./dojob2
#!/bin/sh
# scriptname: dojob2
echo "In dojob2: $testvar"
Both scripts should be in the same directory.
If not, enter full path in stead of ./dojob2
Greetings,
Philippe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2006 04:16 AM
02-15-2006 04:16 AM
Re: Batch Job Submission Script
David, Is there something similar in Posix Shell?
Arturo, I am not familiar with the command 'noput'. We are using the posix shell.
Phillipe, I need all the source in one file and the program must run offline in batch. However, the process to submit the job could create temp files in order to successfully launch the program.
Thanks again and keep trying!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2006 07:13 AM
02-22-2006 07:13 AM
Re: Batch Job Submission Script
read x
batchjob($x)