Re: [EXTERNAL] Chaining unix commands

2022-01-24 Thread Paul Gilmartin
On Mon, 24 Jan 2022 21:59:53 +, Dave Barry wrote: >Is it possible the "\" is taken as an escape character? > You came in late, but didn't read further in the conversation to where the OP said that he was using "find ... -exec ... \; " Yes, "\" escapes the ";" as a shell token. And find requ

Re: [EXTERNAL] Chaining unix commands

2022-01-24 Thread Kirk Wolf
anuary 23, 2022 7:08 AM > To: IBM-MAIN@LISTSERV.UA.EDU > Subject: [EXTERNAL] Chaining unix commands > > CAUTION! This email originated outside of the organization. Please do not > open attachments or click

Re: [EXTERNAL] Chaining unix commands

2022-01-24 Thread Dave Barry
Is it possible the "\" is taken as an escape character? -Original Message- From: IBM Mainframe Discussion List On Behalf Of ITschak Mugzach Sent: Sunday, January 23, 2022 7:08 AM To: IBM-MAIN@LISTSERV.UA.EDU Subject: [EXTERNAL] Chaining unix commands CAUTION! This email

Re: Chaining unix commands

2022-01-24 Thread ITschak Mugzach
Peter, the names supplied were just to demonstrate the need... ITschak Mugzach *|** IronSphere Platform* *|* *Information Security Continuous Monitoring for z/OS, x/Linux & IBM I **| z/VM coming soon * On Mon, Jan 24, 2022 at 10:50 AM Peter Sylvester wrote: > On 24/01/2022 06:28, Itschak Mu

Re: Chaining unix commands

2022-01-24 Thread Peter Sylvester
On 24/01/2022 06:28, Itschak Mugzach wrote: Sorry: find / -name *.txt -exec echo {}; echo {} >> all.txt ; cat {} >> all.txt \; find / -name '*.txt' -exec sh -c 'echo {}; echo {} >> all.txt ; cat {} >>all.txt' \; might worlk, (but as already said, all.txt is probably not the best choice for

Re: Chaining unix commands

2022-01-23 Thread Paul Gilmartin
On Mon, 24 Jan 2022 07:28:24 +0200, Itschak Mugzach wrote: >Sorry: find / -name *.txt -exec echo {}; echo {} >> all.txt ; cat {} >>>all.txt \; > I doubt that you want to search the entire filesystem, "/". Note that "all.txt" might be both input and output which may be undesirable. Then: 534

Re: Chaining unix commands

2022-01-23 Thread Itschak Mugzach
Sorry: find / -name *.txt -exec echo {}; echo {} >> all.txt ; cat {} >> all.txt \; This doesn't work with or without quotes. *| **Itschak Mugzach | Director | SecuriTeam Software **|** IronSphere Platform* *|* *Information Security Continuous Monitoring for Z/OS, zLinux and IBM I **| * *|* *Em

Re: Chaining unix commands

2022-01-23 Thread Paul Gilmartin
On Mon, 24 Jan 2022 07:17:17 +0200, Itschak Mugzach wrote: >Example: ls *.txt -exec echo {}; echo {} >> all.txt ; cat {} >> all.txt \; > "ls" has no such operand as "-exec". Are you thinking of a "find" command? -- gil -- For I

Re: Chaining unix commands

2022-01-23 Thread Itschak Mugzach
sing. > > > > > > -- > > Shmuel (Seymour J.) Metz > > http://mason.gmu.edu/~smetz3 > > > > > > From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on > behalf of ITschak Mugzach [imugz...@gmail.com] > > Se

Re: Chaining unix commands

2022-01-23 Thread Kirk Wolf
ERV.UA.EDU] on behalf of > ITschak Mugzach [imugz...@gmail.com] > Sent: Sunday, January 23, 2022 7:08 AM > To: IBM-MAIN@LISTSERV.UA.EDU > Subject: Chaining unix commands > > I am trying to chain some commands by using a primary command -exec > subcommand1; subcommand2; \; > &g

Re: Chaining unix commands

2022-01-23 Thread Seymour J Metz
: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of ITschak Mugzach [imugz...@gmail.com] Sent: Sunday, January 23, 2022 7:08 AM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Chaining unix commands I am trying to chain some commands by using a primary command -exec subcommand1; subcommand2; \;

Re: Chaining unix commands

2022-01-23 Thread Paul Gilmartin
On Sun, 23 Jan 2022 16:18:11 +0200, ITschak Mugzach wrote: >Gil, it works find for one level -exec of find command. I want it to run >more commands by chaining. > Ah! You hadn't mentioned "find" earlier. Something such as: 501 $ find . -name x -exec sh -c 'ls -ld {}; wc {}' \; -rw-r--r-- 1

Re: Chaining unix commands

2022-01-23 Thread ITschak Mugzach
Gil, it works find for one level -exec of find command. I want it to run more commands by chaining. ITschak ITschak Mugzach *|** IronSphere Platform* *|* *Information Security Continuous Monitoring for z/OS, x/Linux & IBM I **| z/VM coming soon * On Sun, Jan 23, 2022 at 4:16 PM Paul Gilmarti

Re: Chaining unix commands

2022-01-23 Thread Paul Gilmartin
On Sun, 23 Jan 2022 14:08:02 +0200, ITschak Mugzach wrote: >I am trying to chain some commands by using a primary command -exec >subcommand1; subcommand2; \; > >for some reason, uss doesn't see the ending (slashed) semicolon. In order >to ignore the confusion, I also tried > Please be very liiter

Chaining unix commands

2022-01-23 Thread ITschak Mugzach
I am trying to chain some commands by using a primary command -exec subcommand1; subcommand2; \; for some reason, uss doesn't see the ending (slashed) semicolon. In order to ignore the confusion, I also tried primary command -exec subcommand1 && subcommand2 && ... &&\; with no success. Any ideas?