RE: [U2] Running a command from / via PCPERFORM

2006-03-13 Thread Dean.Armbruster
PCPERFORM can do multiple commands.  Separate them with a linefeed
(char(10)).  You can actually pass in a text stream that is a script for
the shell if you like, with if's and else's and other stuff, with a
linefeed between lines.  We use this run commands in other accounts
without leaving the current udt.  It will cd to another account, verify
that the cd was successful, and run udt in that directory.

This is on HP-UX with the Bourne shell.  I don't know about other
shells, other unix, or Windows.

Dean Armbruster
Ferguson Enterprises, Inc.



 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Kevin King
 Sent: Monday, March 13, 2006 3:40 PM
 To: u2-users@listserver.u2ug.org
 Subject: [U2] Running a command from / via PCPERFORM
 
 I am trying to PCPERFORM an OS-level command that has to be 
 run from the root directory.  Other than creating a shell 
 script and executing that script, is there a way to structure 
 the commands following PCPERFORM to allow a cd to the root 
 directory and then run the command?  More importantly, is 
 there a platform independent way of doing it so that I don't 
 have to have customizations for Windows vs.
 *nix?
  
 Believe me, if there was a way to do this without having to 
 be at the root, that would be preferable, but this program 
 just happens to require the current working directory to be 
 the root before the command is executed.
  
 -Kevin
 [EMAIL PROTECTED]
 http://www.PrecisOnline.com
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Running a command from / via PCPERFORM

2006-03-13 Thread Timothy Snyder
Dean Armbruster wrote on 03/13/2006 04:33:27 PM:

 PCPERFORM can do multiple commands.  Separate them with a linefeed
 (char(10)).
snip
 This is on HP-UX with the Bourne shell.  I don't know about other
 shells, other unix, or Windows.

Unfortunately, this won't work on Windows.  Neither will the semicolon as 
proposed in a previous posting.  On Windows you can use an ampersand as a 
line separator.  Of course, if you use that same construct in UNIX you'll 
get totally different results (possibly amusing, possibly frightening, 
definitely incorrect), since anything preceding the ampersand will be 
launched as a background process with the rest being tossed.  If you have 
software that needs to work on both NIX and Doze, you'll probably have to 
check SYSTEM(33) to see which you're running, and assign your continuation 
character accordingly.  Hey, you'll probably be doing that anyway, to deal 
with forward slashes versus backslashes and some other things.


Tim Snyder
Consulting I/T Specialist , U2 Professional Services
North American Lab Services
DB2 Information Management, IBM Software Group
717-545-6403
[EMAIL PROTECTED]
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Running a command from / via PCPERFORM

2006-03-13 Thread Michael Doyle
On Mon, 2006-03-13 at 17:08 -0500, Timothy Snyder wrote:
 Dean Armbruster wrote on 03/13/2006 04:33:27 PM:
 
  PCPERFORM can do multiple commands.  Separate them with a linefeed
  (char(10)).
 snip
  This is on HP-UX with the Bourne shell.  I don't know about other
  shells, other unix, or Windows.
 
 Unfortunately, this won't work on Windows.  Neither will the semicolon as 
 proposed in a previous posting.  On Windows you can use an ampersand as a 
 line separator.  Of course, if you use that same construct in UNIX you'll 
 get totally different results (possibly amusing, possibly frightening, 
 definitely incorrect), since anything preceding the ampersand will be 
 launched as a background process with the rest being tossed.  

But what if we use TWO ampersands?! It's so crazy, it just might work:

cd something  runcommand

In both DOS and Bourne this command will change directory to something
and, if that succeeded, execute runcommand. How you get 'something' to
be '\' in DOS and '/' in UNIX is up to you. Which is to say, I don't
think it's possible.

Thanks,

Michael Doyle
Linux Administrator / Developer
AMO Recoveries
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/