Re: Coding IF statement in BPXBATCH shell

2022-02-14 Thread Seymour J Metz
Of course, and a lot of shops understand the benefits. But at some shops 
procurement is a nightmare, as is getting bills paid on time. I'd be very 
surprised if you don't have some problem customers.

That said, I've also been at shops that allow me to install free software, 
allow me to purchase software if I can demonstrate benefits, allow me to 
purchase optional support and pay renewal fees on time.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
Kirk Wolf [k...@dovetail.com]
Sent: Sunday, February 13, 2022 10:15 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Coding IF statement in BPXBATCH shell

Of course you know that there is a paid Enterprise License with support.

http://secure-web.cisco.com/1cTdqhQxR45YSp2Aof_p0n4TjR24yG1BSwBleydMBip_rLIL2uqQ8F-73RsZ49_Wgve1789lmjE8Wwb_W-YvCaCid-1geuSC_HiWgCiQVQPZr4yJEY0uVNX54hx7-MjWUqVWjAn03-jT6KaaqNQe-fjWLh-muigtVfFj2txS3ZvsBBlv7_lrfx13MefRbON45CuQoCp_ma2Vk2VyGeNZjOGW5XsbBszH-za7mMSpDMFuK9kv_Px52nDbjLWUj1N4dqDXjKFWqj_6FjHvAEB0nxZFKqljF28UhOrZmFkgUwjSaoAEe2a01zWpyIF3v34SlFAXIQWknJos0tVSfRyb1FsAJP9c9feXGfVks5HrXj01GwDVa2-kHmtN6Zz-EG_fQ8NxLKhIl4ZR0sFZUWIED1buOsuhGVoQDdy0aFGG4yBjRKGBMFuLJ3R5sM41pzObE/http%3A%2F%2Fdovetail.com%2Fsupport.html

Kirk Wolf
Dovetailed Technologies



On Sat, Feb 12, 2022, at 8:26 PM, Seymour J Metz wrote:
> Some shops won't let you install free software, but for everybody else, that 
> sounds like the reasonable thing to do/
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
> 
> From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
> David Crayford [dcrayf...@gmail.com]
> Sent: Friday, February 11, 2022 9:02 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: Coding IF statement in BPXBATCH shell
>
> My advice is not to use BPXBATCH, it's garbage! Run, don't walk, over to
> Dovetailed Softwares website and download their Co:Z toolkit. There is a
> batch utility called COZBATCH which allows you to run shell scripts from
> data sets, including inline JCL.
>
> Co:Z toolkit is free with optional paid support.
>
> https://secure-web.cisco.com/1QmaMysIy6vmV-VlgjMJ56Kb9ngXSViU3fshLvPElZvpjLhvwGE1TLJCXM3Lnph7b-KZkJBvlDTImYUCo6RTeTxbVdW_mN3f6s7w-hHqI5qbda8OGHb35p2ZWidf4OL8WeGLmP_fY3riY_5-x6eRvRS8kAzblNio4OxCAMBLKyWtA4zhgP4o0_5bxyyjorKK4Q5koCHDsW1dWtydDCiZILcjV1LwTk3eDDZ5WEJPP62t28PPtqYfMIOkb05cczMpivBIn6ACuuSrLu8-YrlnAtN3fTRE3sDU58s2cMh27xaY_PRqd26ZBzIpt-gY4SXyGe8wR2-tUBgBo7m87Nff4nsS4tFkYL2OLmsIClNwiJTENzyqNTVCE8RFxOgpoeVrSPLXqii7hKN9sC0nrpJBOv681dMU0wKgmmQiTNwVUb_oIEiLT17Azk83w7aEn_Wjs/https%3A%2F%2Fdovetail.com%2Fproducts%2Fcozbatch.html
>
>
> On 12/2/22 4:20 am, Billy Ashton wrote:
> > Hey everyone...I am having a tough time with a shell script I am
> > writing for my BPXBATCH step. All I want to do is run one of two
> > commands depending on a variable that is passed to the script.
> >
> > I have tried coding
> > if [ "$pet" == "DOG" ] ; then
> >commands...
> > else
> >other commands
> > fi
> >
> > and I have tried
> > if [[  ]]
> > if [ ... = ... ]
> >
> > all with the same result:
> > + DOG == DOG
> > DOG: /tmp/bpxshel.sh 48: FSUM7351 not found or
> > ..: (I think these are the two square brackets) or
> > .: (this is the one square bracket)
> >
> > So, how in the world do I code an IF statement in this BPXBATCH script
> > to do a simple string compare?
> >
> > Thank you and best regards,
> > Billy Ashton
> >
> > --
> > For IBM-MAIN subscribe / signoff / archive access instructions,
> > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

Kirk Wolf
Dovetailed Technologies
http://secure-web.cisco.com/1I3BEFmvMPS04uLCGMt3MAIXchuTf40rpsgroIm8w9x1C8Zr4W0v6oaoohO2-kGdfry2lAelpZTst7dT9oX1lmx3PYqfR-n84NiR44ZWLp2JYSrh9IuOms6ZjCNbxaAFpio4pZjo-0vaMKvjTJGb7jG0Yb2cSdNgB4h9h-hmlOTyd1S4FSO8hs4tW3dwv1CaQg_dTTMoi5cHkIG6_RDdr2yxxBgg4s7uvtVksRQfmySvC7GQ20RH5o6Rq_tcZS_YoQpY0OCPmxLgjJFQ_uJsixQR4Ko2WwzZB_1uiZx2WqbAaLjEW4UkabbAyzX1Wn0yhAwF00HuP3EEGu2g548Z4B5Wg7AJnIEpltZVNSBRB1hnz0b3DSmTgg33V

Re: Coding IF statement in BPXBATCH shell

2022-02-13 Thread David Crayford

On 14/2/22 11:15 am, Kirk Wolf wrote:

Of course you know that there is a paid Enterprise License with support.

http://dovetail.com/support.html


Yes, that's the same with Rocket Ported Tools and IBM's ported tools 
such as Python, Node.js, Golang and I expect clang/LLVM to be added to 
that list. If you want to use these software packages free of charge 
that's up to you.
But no customer will put something into production without support. For 
tools, such as Rocket binutils, a lot of customers don't pay. But for 
Git they typically do and we are seeing a lot of uptake.


Of course, there is Zowe which is also free. But IBM and vendors aim to 
make money by using the Zowe framework for products.


There is an obvious ignorance on this forum to business models such as 
free with paid support, free core etc.





Kirk Wolf
Dovetailed Technologies



On Sat, Feb 12, 2022, at 8:26 PM, Seymour J Metz wrote:

Some shops won't let you install free software, but for everybody else, that 
sounds like the reasonable thing to do/


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
David Crayford [dcrayf...@gmail.com]
Sent: Friday, February 11, 2022 9:02 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Coding IF statement in BPXBATCH shell

My advice is not to use BPXBATCH, it's garbage! Run, don't walk, over to
Dovetailed Softwares website and download their Co:Z toolkit. There is a
batch utility called COZBATCH which allows you to run shell scripts from
data sets, including inline JCL.

Co:Z toolkit is free with optional paid support.

https://secure-web.cisco.com/1QmaMysIy6vmV-VlgjMJ56Kb9ngXSViU3fshLvPElZvpjLhvwGE1TLJCXM3Lnph7b-KZkJBvlDTImYUCo6RTeTxbVdW_mN3f6s7w-hHqI5qbda8OGHb35p2ZWidf4OL8WeGLmP_fY3riY_5-x6eRvRS8kAzblNio4OxCAMBLKyWtA4zhgP4o0_5bxyyjorKK4Q5koCHDsW1dWtydDCiZILcjV1LwTk3eDDZ5WEJPP62t28PPtqYfMIOkb05cczMpivBIn6ACuuSrLu8-YrlnAtN3fTRE3sDU58s2cMh27xaY_PRqd26ZBzIpt-gY4SXyGe8wR2-tUBgBo7m87Nff4nsS4tFkYL2OLmsIClNwiJTENzyqNTVCE8RFxOgpoeVrSPLXqii7hKN9sC0nrpJBOv681dMU0wKgmmQiTNwVUb_oIEiLT17Azk83w7aEn_Wjs/https%3A%2F%2Fdovetail.com%2Fproducts%2Fcozbatch.html


On 12/2/22 4:20 am, Billy Ashton wrote:

Hey everyone...I am having a tough time with a shell script I am
writing for my BPXBATCH step. All I want to do is run one of two
commands depending on a variable that is passed to the script.

I have tried coding
if [ "$pet" == "DOG" ] ; then
commands...
else
other commands
fi

and I have tried
if [[  ]]
if [ ... = ... ]

all with the same result:
+ DOG == DOG
DOG: /tmp/bpxshel.sh 48: FSUM7351 not found or
..: (I think these are the two square brackets) or
.: (this is the one square bracket)

So, how in the world do I code an IF statement in this BPXBATCH script
to do a simple string compare?

Thank you and best regards,
Billy Ashton

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Kirk Wolf
Dovetailed Technologies
http://dovetail.com

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Coding IF statement in BPXBATCH shell

2022-02-13 Thread Kirk Wolf
Of course you know that there is a paid Enterprise License with support.

http://dovetail.com/support.html

Kirk Wolf
Dovetailed Technologies



On Sat, Feb 12, 2022, at 8:26 PM, Seymour J Metz wrote:
> Some shops won't let you install free software, but for everybody else, that 
> sounds like the reasonable thing to do/
> 
> 
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
> 
> 
> From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
> David Crayford [dcrayf...@gmail.com]
> Sent: Friday, February 11, 2022 9:02 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: Coding IF statement in BPXBATCH shell
> 
> My advice is not to use BPXBATCH, it's garbage! Run, don't walk, over to
> Dovetailed Softwares website and download their Co:Z toolkit. There is a
> batch utility called COZBATCH which allows you to run shell scripts from
> data sets, including inline JCL.
> 
> Co:Z toolkit is free with optional paid support.
> 
> https://secure-web.cisco.com/1QmaMysIy6vmV-VlgjMJ56Kb9ngXSViU3fshLvPElZvpjLhvwGE1TLJCXM3Lnph7b-KZkJBvlDTImYUCo6RTeTxbVdW_mN3f6s7w-hHqI5qbda8OGHb35p2ZWidf4OL8WeGLmP_fY3riY_5-x6eRvRS8kAzblNio4OxCAMBLKyWtA4zhgP4o0_5bxyyjorKK4Q5koCHDsW1dWtydDCiZILcjV1LwTk3eDDZ5WEJPP62t28PPtqYfMIOkb05cczMpivBIn6ACuuSrLu8-YrlnAtN3fTRE3sDU58s2cMh27xaY_PRqd26ZBzIpt-gY4SXyGe8wR2-tUBgBo7m87Nff4nsS4tFkYL2OLmsIClNwiJTENzyqNTVCE8RFxOgpoeVrSPLXqii7hKN9sC0nrpJBOv681dMU0wKgmmQiTNwVUb_oIEiLT17Azk83w7aEn_Wjs/https%3A%2F%2Fdovetail.com%2Fproducts%2Fcozbatch.html
> 
> 
> On 12/2/22 4:20 am, Billy Ashton wrote:
> > Hey everyone...I am having a tough time with a shell script I am
> > writing for my BPXBATCH step. All I want to do is run one of two
> > commands depending on a variable that is passed to the script.
> >
> > I have tried coding
> > if [ "$pet" == "DOG" ] ; then
> >commands...
> > else
> >other commands
> > fi
> >
> > and I have tried
> > if [[  ]]
> > if [ ... = ... ]
> >
> > all with the same result:
> > + DOG == DOG
> > DOG: /tmp/bpxshel.sh 48: FSUM7351 not found or
> > ..: (I think these are the two square brackets) or
> > .: (this is the one square bracket)
> >
> > So, how in the world do I code an IF statement in this BPXBATCH script
> > to do a simple string compare?
> >
> > Thank you and best regards,
> > Billy Ashton
> >
> > --
> > For IBM-MAIN subscribe / signoff / archive access instructions,
> > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> 
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> 
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> 

Kirk Wolf
Dovetailed Technologies
http://dovetail.com

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Coding IF statement in BPXBATCH shell

2022-02-13 Thread Seymour J Metz
I love it!


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
Paul Gilmartin [000433f07816-dmarc-requ...@listserv.ua.edu]
Sent: Saturday, February 12, 2022 9:52 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Coding IF statement in BPXBATCH shell

On Sun, 13 Feb 2022 01:26:41 +, Seymour J Metz wrote:

>Some shops won't let you install free software, but for everybody else, that 
>sounds like the reasonable thing to do/
>
The supplier should offer a "Pro" version for $0.01; perhaps with
more attractive page headers (date in Roman numerals?)

--
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Coding IF statement in BPXBATCH shell

2022-02-12 Thread Paul Gilmartin
On Sun, 13 Feb 2022 01:26:41 +, Seymour J Metz wrote:

>Some shops won't let you install free software, but for everybody else, that 
>sounds like the reasonable thing to do/
> 
The supplier should offer a "Pro" version for $0.01; perhaps with
more attractive page headers (date in Roman numerals?)

-- 
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Coding IF statement in BPXBATCH shell

2022-02-12 Thread Seymour J Metz
Some shops won't let you install free software, but for everybody else, that 
sounds like the reasonable thing to do/


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
David Crayford [dcrayf...@gmail.com]
Sent: Friday, February 11, 2022 9:02 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Coding IF statement in BPXBATCH shell

My advice is not to use BPXBATCH, it's garbage! Run, don't walk, over to
Dovetailed Softwares website and download their Co:Z toolkit. There is a
batch utility called COZBATCH which allows you to run shell scripts from
data sets, including inline JCL.

Co:Z toolkit is free with optional paid support.

https://secure-web.cisco.com/1QmaMysIy6vmV-VlgjMJ56Kb9ngXSViU3fshLvPElZvpjLhvwGE1TLJCXM3Lnph7b-KZkJBvlDTImYUCo6RTeTxbVdW_mN3f6s7w-hHqI5qbda8OGHb35p2ZWidf4OL8WeGLmP_fY3riY_5-x6eRvRS8kAzblNio4OxCAMBLKyWtA4zhgP4o0_5bxyyjorKK4Q5koCHDsW1dWtydDCiZILcjV1LwTk3eDDZ5WEJPP62t28PPtqYfMIOkb05cczMpivBIn6ACuuSrLu8-YrlnAtN3fTRE3sDU58s2cMh27xaY_PRqd26ZBzIpt-gY4SXyGe8wR2-tUBgBo7m87Nff4nsS4tFkYL2OLmsIClNwiJTENzyqNTVCE8RFxOgpoeVrSPLXqii7hKN9sC0nrpJBOv681dMU0wKgmmQiTNwVUb_oIEiLT17Azk83w7aEn_Wjs/https%3A%2F%2Fdovetail.com%2Fproducts%2Fcozbatch.html


On 12/2/22 4:20 am, Billy Ashton wrote:
> Hey everyone...I am having a tough time with a shell script I am
> writing for my BPXBATCH step. All I want to do is run one of two
> commands depending on a variable that is passed to the script.
>
> I have tried coding
> if [ "$pet" == "DOG" ] ; then
>commands...
> else
>other commands
> fi
>
> and I have tried
> if [[  ]]
> if [ ... = ... ]
>
> all with the same result:
> + DOG == DOG
> DOG: /tmp/bpxshel.sh 48: FSUM7351 not found or
> ..: (I think these are the two square brackets) or
> .: (this is the one square bracket)
>
> So, how in the world do I code an IF statement in this BPXBATCH script
> to do a simple string compare?
>
> Thank you and best regards,
> Billy Ashton
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Coding IF statement in BPXBATCH shell

2022-02-11 Thread David Crayford
I forgot to mention. The Co:Z toolkit also provides a plethora of useful 
shell utilities for copying files between the MVS file system and z/OS 
UNIX that blow away what IBM ship with the base OS. We use them 
extensively where I work and at my previous company. There is also the 
port of SFTP which supports MVS data sets and the JES spool. It also 
supports file tagging in the file system so I've dumped FTP for good.


On 12/2/22 10:02 am, David Crayford wrote:
My advice is not to use BPXBATCH, it's garbage! Run, don't walk, over 
to Dovetailed Softwares website and download their Co:Z toolkit. There 
is a batch utility called COZBATCH which allows you to run shell 
scripts from data sets, including inline JCL.


Co:Z toolkit is free with optional paid support.

https://dovetail.com/products/cozbatch.html


On 12/2/22 4:20 am, Billy Ashton wrote:
Hey everyone...I am having a tough time with a shell script I am 
writing for my BPXBATCH step. All I want to do is run one of two 
commands depending on a variable that is passed to the script.


I have tried coding
if [ "$pet" == "DOG" ] ; then
   commands...
else
   other commands
fi

and I have tried
if [[  ]]
if [ ... = ... ]

all with the same result:
+ DOG == DOG
DOG: /tmp/bpxshel.sh 48: FSUM7351 not found or
..: (I think these are the two square brackets) or
.: (this is the one square bracket)

So, how in the world do I code an IF statement in this BPXBATCH 
script to do a simple string compare?


Thank you and best regards,
Billy Ashton

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Coding IF statement in BPXBATCH shell

2022-02-11 Thread Paul Gilmartin
On Sat, 12 Feb 2022 10:02:16 +0800, David Crayford  wrote:

>...  COZBATCH which allows you to run shell scripts from
>data sets, including inline JCL.
> 
Do you mean JCL in a here- document?  To what end?  Or
a script in an instream data set?

>Co:Z toolkit is free with optional paid support.
> 
Many IT admins deem deem that price unacceptable.

>https://dovetail.com/products/cozbatch.html
>
Less restrictive alternatives include AOPBATCH,
a component of the separately priced but popular
Infoprint and BPXWUNIX (Rexx driver required;
easier with z/OS 2.5 support of instream Rexx.)

-- 
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Coding IF statement in BPXBATCH shell

2022-02-11 Thread David Crayford
My advice is not to use BPXBATCH, it's garbage! Run, don't walk, over to 
Dovetailed Softwares website and download their Co:Z toolkit. There is a 
batch utility called COZBATCH which allows you to run shell scripts from 
data sets, including inline JCL.


Co:Z toolkit is free with optional paid support.

https://dovetail.com/products/cozbatch.html


On 12/2/22 4:20 am, Billy Ashton wrote:
Hey everyone...I am having a tough time with a shell script I am 
writing for my BPXBATCH step. All I want to do is run one of two 
commands depending on a variable that is passed to the script.


I have tried coding
if [ "$pet" == "DOG" ] ; then
   commands...
else
   other commands
fi

and I have tried
if [[  ]]
if [ ... = ... ]

all with the same result:
+ DOG == DOG
DOG: /tmp/bpxshel.sh 48: FSUM7351 not found or
..: (I think these are the two square brackets) or
.: (this is the one square bracket)

So, how in the world do I code an IF statement in this BPXBATCH script 
to do a simple string compare?


Thank you and best regards,
Billy Ashton

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Coding IF statement in BPXBATCH shell

2022-02-11 Thread Paul Gilmartin
On Fri, 11 Feb 2022 23:03:08 +, Farley, Peter x23353 wrote:

>PMFJI, but isn't the shell script string equality compare operator a double 
>equal sign, "==", following the C convention?
>
No: 


-- 
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Coding IF statement in BPXBATCH shell

2022-02-11 Thread Farley, Peter x23353
PMFJI, but isn't the shell script string equality compare operator a double 
equal sign, "==", following the C convention?

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of 
Paul Gilmartin
Sent: Friday, February 11, 2022 5:51 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Coding IF statement in BPXBATCH shell

On Fri, 11 Feb 2022 18:33:41 -0400, Kurt J. Quackenbush  wrote:
>
>Try like this:
>
>pet=dog;
>if [ $pet -eq "dog" ]; then
>
"-eq" compares numbers; "=" compares strings. Example:
537 $ [ 00042 -eq 42 ]; echo $?
0
538 $ [ 00042 =   42 ]; echo $?
1
539 $ 

And "$pet" needs to be quoted lest a user sneak in:
pet="Tasmanian Devil"

>  echo "feed dog";
>else
>  echo "feed cat";
>fi;

-- 


This message and any attachments are intended only for the use of the addressee 
and may contain information that is privileged and confidential. If the reader 
of the message is not the intended recipient or an authorized representative of 
the intended recipient, you are hereby notified that any dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately by e-mail and delete the message and any 
attachments from your system.


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Coding IF statement in BPXBATCH shell

2022-02-11 Thread Paul Gilmartin
On Fri, 11 Feb 2022 18:33:41 -0400, Kurt J. Quackenbush  wrote:
>
>Try like this:
>
>pet=dog; 
>if [ $pet -eq "dog" ]; then
>
"-eq" compares numbers; "=" compares strings. Example:
537 $ [ 00042 -eq 42 ]; echo $?
0
538 $ [ 00042 =   42 ]; echo $?
1
539 $ 

And "$pet" needs to be quoted lest a user sneak in:
pet="Tasmanian Devil"

>  echo "feed dog"; 
>else 
>  echo "feed cat"; 
>fi; 

--
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Coding IF statement in BPXBATCH shell

2022-02-11 Thread Kurt J. Quackenbush
> Hey everyone...I am having a tough time with a shell script I am writing 

> for my BPXBATCH step. All I want to do is run one of two commands 
> depending on a variable that is passed to the script.
> 
> I have tried coding
> if [ "$pet" == "DOG" ] ; then
> commands...
> else
> other commands
> fi

Try like this:

pet=dog; 
if [ $pet -eq "dog" ]; then;
  echo "feed dog"; 
else 
  echo "feed cat"; 
fi; 

Kurt Quackenbush -- IBM, z/OS SMP/E and z/OSMF Software Management
Chuck Norris never uses CHECK when he applies PTFs.



--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Coding IF statement in BPXBATCH shell

2022-02-11 Thread Paul Gilmartin
On Fri, 11 Feb 2022 20:20:04 +, Billy Ashton wrote:

>Hey everyone...I am having a tough time with a shell script I am writing 
>for my BPXBATCH step. All I want to do is run one of two commands 
>depending on a variable that is passed to the script.
>
(This might be more topical on MVS-OE.)
(You'd do better to test scripts interactively before introducing
the complexity of BPXBATCH.)

>I have tried coding
>if [ "$pet" == "DOG" ] ; then
>commands...
>else
>other commands
>fi
>
See:


My attempt:
536 $ cat comp
#! /bin/sh -x
if [ "DOG" = "$pet" ] ; then
echo commands...
else
echo other commands
fi
537 $ 
Results:
534 $ pet=DOG ./comp
comp 2+ '[' DOG = DOG ']'
comp 3+ echo commands...
commands...
535 $ 
535 $ pet=cat ./comp
comp 2+ '[' DOG = cat ']'
comp 5+ echo other commands
other commands
536 $ 

Pro tip:  Code the constant first lest the value of a variable
be mistaken for a prefix operator.

-- 
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN