Re: apply unix command under 3.4 to pathname dir
On 3/6/22 04:33, Paul Gilmartin wrote: On Thu, 2 Jun 2022 15:19:47 -0500, Erik Janssen wrote: Ah yes, it is actually on the panel; 'Use the pathname substitution character !' :-) That what I was looking for, I already thought that there had to be some way, I just didn't notice it. I was already using 3.17 basically, but since some recent z/os release you can just type in a unix directory under 3.4 and it will automatically bring you to 3.17. From the responses so far this seems like a well hidden feature :-) So, what works for me is to put an X for the . (current directory) in the filelist, then use cd !;git status as a command with option 2 (login shell). Wouldn't it be simpler to work under a z/OS UNIX shell rather than struggling with the recondite conventions of ISPF? ISPF is a half decent z/OS UNIX file manager. Rocket Ported Tools includes Midnight Commander but ISPF is more than usable. I personally would stick to a shell for executing Git commands as some invoke pagers or use color coding so don't work well outputting to an ISPF Browse panel. BTW, how can one use a literal "!", not as a pathname substitution character? -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: apply unix command under 3.4 to pathname dir
On Thu, 2 Jun 2022 16:23:01 -0500, Erik Janssen wrote: >Not sure if the ! can be escaped in any way, but I saw it is possible to set >another character in the options as the pathname substitution character. > I dislike alternative metacharacters. They require that I select characters that I expect not to use in actual code yet easily accessible on a keyboard. Escapes are more general, as in: 1035 $ echo foo | sed -E s/foo/" \\( ; \\) ! \\/ \" ' "/ ( ; ) ! / " ' Imagine the analogue in ISPF Edit: Chhange c'foo' ? The only way to code the replacement is as a hex string. Ugh! >In my case I would definitately prefer to use an ssh session or the omvs >shell, but I was looking if there were options for users that have less >experience with unix to still be able to give commands this way. > That's valid only if those users need only your script; never other shell commands. Otherwise they're better off learning whatever UNIX they need, not a transcription into ISPF jargon. >I also found out that you can use dirname and basename to get the directory >name and filename portion of the path. >cd `dirname !`;pwd;basename !; > Here, I'll advocate not a substitution character but an environment varable, e.g. ISPPATH (assuming $ISP is a reserved prefix.) then your command can use shell intrinsics: cd "${ISPPATH%/*}"; pwd; "${ISPPATH##*/}" which fanatics advocate for performance. It avoids two forks. (I usually code "cd "whatever" || exit $?" -- never trust my caller. -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: apply unix command under 3.4 to pathname dir
Not sure if the ! can be escaped in any way, but I saw it is possible to set another character in the options as the pathname substitution character. In my case I would definitately prefer to use an ssh session or the omvs shell, but I was looking if there were options for users that have less experience with unix to still be able to give commands this way. I also found out that you can use dirname and basename to get the directory name and filename portion of the path. cd `dirname !`;pwd;basename !; Kind regards, Erik. On Thu, 2 Jun 2022 15:33:46 -0500, Paul Gilmartin wrote: >On Thu, 2 Jun 2022 15:19:47 -0500, Erik Janssen wrote: > >>Ah yes, it is actually on the panel; 'Use the pathname substitution character >>!' :-) >>That what I was looking for, I already thought that there had to be some way, >>I just didn't notice it. >>I was already using 3.17 basically, but since some recent z/os release you >>can just type in a unix directory under 3.4 and it will automatically bring >>you to 3.17. From the responses so far this seems like a well hidden feature >>:-) >>So, what works for me is to put an X for the . (current directory) in the >>filelist, then use cd !;git status as a command with option 2 (login shell). >> >Wouldn't it be simpler to work under a z/OS UNIX shell rather than struggling >with >the recondite conventions of ISPF? > >BTW, how can one use a literal "!", not as a pathname substitution character? > >-- >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: apply unix command under 3.4 to pathname dir
On Thu, 2 Jun 2022 15:19:47 -0500, Erik Janssen wrote: >Ah yes, it is actually on the panel; 'Use the pathname substitution character >!' :-) >That what I was looking for, I already thought that there had to be some way, >I just didn't notice it. >I was already using 3.17 basically, but since some recent z/os release you can >just type in a unix directory under 3.4 and it will automatically bring you to >3.17. From the responses so far this seems like a well hidden feature :-) >So, what works for me is to put an X for the . (current directory) in the >filelist, then use cd !;git status as a command with option 2 (login shell). > Wouldn't it be simpler to work under a z/OS UNIX shell rather than struggling with the recondite conventions of ISPF? BTW, how can one use a literal "!", not as a pathname substitution character? -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: apply unix command under 3.4 to pathname dir
Ah yes, it is actually on the panel; 'Use the pathname substitution character !' :-) That what I was looking for, I already thought that there had to be some way, I just didn't notice it. I was already using 3.17 basically, but since some recent z/os release you can just type in a unix directory under 3.4 and it will automatically bring you to 3.17. From the responses so far this seems like a well hidden feature :-) So, what works for me is to put an X for the . (current directory) in the filelist, then use cd !;git status as a command with option 2 (login shell). Kind regards, Erik. On Thu, 2 Jun 2022 17:49:10 +, Sri h Kolusu wrote: >Erik, > >Did you try option 3.17 ? Provide the path and once in the directory you can >put a slash "/" against the file name you want to execute your command, it >will show you a pop up something like this . Option 23 is to execute a command. > >EsssN >eDirectory List Actions e >e e >e File - /u/user/myfile.xxx e >e e >e DIRLIST Actione >e 1. Edit 14. Information e >e 2. Edit - ASCII 15. File System e >e 3. Edit - UTF-8 16. Modify Mode Fields e >e 4. View 17. Modify Extended Attrse >e 5. View - ASCII 18. Modify Owning User e >e 6. View - UTF-8 19. Modify Owning Group e >e 7. Browse 20. Modify Formate >e 8. New 21. User Auditinge >e 9. Directory List 22. Auditor Auditing e >e 10. Delete 23. Execute command e >e 11. Rename 24. Refadd e >e 12. Copy Out 25. Manage ACLs e >e 13. Copy In e >e e >e Select a choice and press ENTER to process data set action. e >DsssM > >And after that you will provided to enter you command and way to run it > >Pathname . . . . /u/user/myfile.xxx > >Enter the command below. Use the pathname substitution character ! >to indicate where to have the pathname substituted. If not specified, the >pathname will be appended to the end of the command. > >Command for file: > > > > >Run method . . .1. Direct >2. Login shell >3. TSO > >z/OS UNIX command time limit . . . > > >Thanks, >Kolusu > > >-- >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: apply unix command under 3.4 to pathname dir
On Thu, 2 Jun 2022 13:46:15 -0500, Mike Schwab wrote: >So you need a command like 'CD .' or 'set WD=.' to define the current > What language has that "CD" command? Won't it just define the current directory as what it already is, a no-op? >directory as the directory for commands to work with. > The OP didn't specify what language he's using: o POSIX shell script? o Rexx? o Other (specify)? -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: apply unix command under 3.4 to pathname dir
So you need a command like 'CD .' or 'set WD=.' to define the current directory as the directory for commands to work with. On Thu, Jun 2, 2022 at 1:36 PM Paul Gilmartin <000433f07816-dmarc-requ...@listserv.ua.edu> wrote: > > On Thu, 2 Jun 2022 17:49:10 +, Sri h Kolusu wrote: > > > >Did you try option 3.17 ? Provide the path and once in the directory you > >can put a slash "/" against the file name you want to execute your command, > >it will show you a pop up something like this . Option 23 is to execute a > >command. > > > I believe that will execute the command but not change the working directory > as the OP needs. Try this with: > >e File - /u/user/gitdir/myfile.xxx > containing "pwd" to see whether it prints: > /u/user/gitdir # or: > /u/user > > >EsssN > >eDirectory List Actions e > >e e > >e File - /u/user/myfile.xxx e > >e e > >e DIRLIST Actione > >e 1. Edit 14. Information e > >e 2. Edit - ASCII 15. File System e > >e 3. Edit - UTF-8 16. Modify Mode Fields e > >e 4. View 17. Modify Extended Attrse > >e 5. View - ASCII 18. Modify Owning User e > >e 6. View - UTF-8 19. Modify Owning Group e > >e 7. Browse 20. Modify Formate > >e 8. New 21. User Auditinge > >e 9. Directory List 22. Auditor Auditing e > >e 10. Delete 23. Execute command e > >e 11. Rename 24. Refadd e > >e 12. Copy Out 25. Manage ACLs e > >e 13. Copy In e > >e e > >e Select a choice and press ENTER to process data set action. e > >DsssM > > > >And after that you will provided to enter you command and way to run it > > > >Pathname . . . . /u/user/myfile.xxx > > > >Enter the command below. Use the pathname substitution character ! > >to indicate where to have the pathname substituted. If not specified, the > >pathname will be appended to the end of the command. > > > >Command for file: > > > >Run method . . .1. Direct > >2. Login shell > >3. TSO > > > >z/OS UNIX command time limit . . . > > -- > gil > > -- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- Mike A Schwab, Springfield IL USA Where do Forest Rangers go to get away from it all? -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: apply unix command under 3.4 to pathname dir
On Thu, 2 Jun 2022 17:49:10 +, Sri h Kolusu wrote: > >Did you try option 3.17 ? Provide the path and once in the directory you can >put a slash "/" against the file name you want to execute your command, it >will show you a pop up something like this . Option 23 is to execute a command. > I believe that will execute the command but not change the working directory as the OP needs. Try this with: >e File - /u/user/gitdir/myfile.xxx containing "pwd" to see whether it prints: /u/user/gitdir # or: /u/user >EsssN >eDirectory List Actions e >e e >e File - /u/user/myfile.xxx e >e e >e DIRLIST Actione >e 1. Edit 14. Information e >e 2. Edit - ASCII 15. File System e >e 3. Edit - UTF-8 16. Modify Mode Fields e >e 4. View 17. Modify Extended Attrse >e 5. View - ASCII 18. Modify Owning User e >e 6. View - UTF-8 19. Modify Owning Group e >e 7. Browse 20. Modify Formate >e 8. New 21. User Auditinge >e 9. Directory List 22. Auditor Auditing e >e 10. Delete 23. Execute command e >e 11. Rename 24. Refadd e >e 12. Copy Out 25. Manage ACLs e >e 13. Copy In e >e e >e Select a choice and press ENTER to process data set action. e >DsssM > >And after that you will provided to enter you command and way to run it > >Pathname . . . . /u/user/myfile.xxx > >Enter the command below. Use the pathname substitution character ! >to indicate where to have the pathname substituted. If not specified, the >pathname will be appended to the end of the command. > >Command for file: > >Run method . . .1. Direct >2. Login shell >3. TSO > >z/OS UNIX command time limit . . . -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: apply unix command under 3.4 to pathname dir
Erik, Did you try option 3.17 ? Provide the path and once in the directory you can put a slash "/" against the file name you want to execute your command, it will show you a pop up something like this . Option 23 is to execute a command. EsssN eDirectory List Actions e e e e File - /u/user/myfile.xxx e e e e DIRLIST Actione e 1. Edit 14. Information e e 2. Edit - ASCII 15. File System e e 3. Edit - UTF-8 16. Modify Mode Fields e e 4. View 17. Modify Extended Attrse e 5. View - ASCII 18. Modify Owning User e e 6. View - UTF-8 19. Modify Owning Group e e 7. Browse 20. Modify Formate e 8. New 21. User Auditinge e 9. Directory List 22. Auditor Auditing e e 10. Delete 23. Execute command e e 11. Rename 24. Refadd e e 12. Copy Out 25. Manage ACLs e e 13. Copy In e e e e Select a choice and press ENTER to process data set action. e DsssM And after that you will provided to enter you command and way to run it Pathname . . . . /u/user/myfile.xxx Enter the command below. Use the pathname substitution character ! to indicate where to have the pathname substituted. If not specified, the pathname will be appended to the end of the command. Command for file: Run method . . .1. Direct 2. Login shell 3. TSO z/OS UNIX command time limit . . . Thanks, Kolusu -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: apply unix command under 3.4 to pathname dir
On Thu, 2 Jun 2022 05:58:05 -0500, Erik Janssen wrote: > >... Is there an easy way to have the command run from within the directory on >the Pathname? > In a Rexx exec/macro I have used "address SYSCALL chdirr ..." successfully to change the working directory of my TSO session. Does that help? -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
apply unix command under 3.4 to pathname dir
Hello List, For some time it is possible to list omvs directories under 3.4. There is an option to enable primary commands entered to be executed as a unix command. However, this will always bring me to my home dir first. Is there an easy way to have the command run from within the directory on the Pathname? For example, I would like to be able to go to 3.4, enter /u/someuser/somegitproject and run a git status command and have it run with /u/someuser/somegitproject as the current directory. Kind regards, Erik Janssen. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN