• Bash script

    From Rick Smith@1:105/10.1 to All on Saturday, June 19, 2021 11:30:12
    Greetings All!

    I believe this is where this ? goes...

    Not sure if this is where I would ask this question or not? I am trying to make bash script to combine a
    couple of other scripts and I had a couple of questions. So If I make a script that performs something
    and then it calls say another script, would the first script then pause until the called side script
    completes? If not is there a way to make it wait to move forward until the other one completes? I hope I
    am describing this well for you.



    ----
    Regards,


    Rick Smith (Nitro)

    ... There's a fine line between BBSing and beebling
    --- GoldED+/LNX 1.1.5-b20180707
    * Origin: ----> Abacus Sysop Point --->>>>bbs.abon.us:2323 (1:105/10.1)
  • From Benny Pedersen@2:230/0 to Rick Smith on Saturday, June 19, 2021 18:40:46
    Hello Rick!

    19 Jun 2021 11:30, Rick Smith wrote to All:

    completes? If not is there a way to make it wait to move forward
    until the other one completes? I hope I
    am describing this well for you.

    bash start_end_off_world.sh && bash stop_end_off_world.sh

    ?

    if start_end_off_world.sh will not end, then the 2nd stop_end_off_world.sh will not be called

    hopefully more linux geeks can stop it :)


    Regards Benny

    ... too late to die young :)

    --- Msged/LNX 6.1.2 (Linux/5.12.12-gentoo-dist (x86_64))
    * Origin: I will always keep a PC running CPM 3.0 (2:230/0)
  • From Maurice Kinal@1:153/7001 to Rick Smith on Saturday, June 19, 2021 22:07:57
    -={ 2021-06-19 22:07:57.627712523+00:00 }=-

    Hey Rick!

    So If I make a script that performs something and then it calls
    say another script, would the first script then pause until the
    called side script completes?

    That is the normal behavior.

    If not is there a way to make it wait to move forward until the
    other one completes?

    -={ '<Esc>:read !wait --help' starts }=-
    wait: wait [-fn] [-p var] [id ...]
    Wait for job completion and return exit status.

    Waits for each process identified by an ID, which may be a process ID or a
    job specification, and reports its termination status. If ID is not
    given, waits for all currently active child processes, and the return
    status is zero. If ID is a job specification, waits for all processes
    in that job's pipeline.

    If the -n option is supplied, waits for a single job from the list of IDs,
    or, if no IDs are supplied, for the next job to complete and returns its
    exit status.

    If the -p option is supplied, the process or job identifier of the job
    for which the exit status is returned is assigned to the variable VAR
    named by the option argument. The variable will be unset initially, before
    any assignment. This is useful only when the -n option is supplied.

    If the -f option is supplied, and job control is enabled, waits for the
    specified ID to terminate, instead of waiting for it to change status.

    Exit Status:
    Returns the status of the last ID; fails if ID is invalid or an invalid
    option is given, or if -n is supplied and the shell has no unwaited-for
    children.
    -={ '<Esc>:read !wait --help' ends }=-

    Of course you only need to do this when the script is running parallel processes where the output from one is needed for another.

    Life is good,
    Maurice

    ... Ælc mann þe wisdom lufaþ biþ gesælig.
    Everyone who loves wisdom is blessed.
    --- GNU bash, version 5.1.8(1)-release (x86_64-motorshed-linux-gnu)
    * Origin: Little Mikey's Brain - Ladysmith BC, Canada (1:153/7001)
  • From Benny Pedersen@2:230/0 to Maurice Kinal on Saturday, June 19, 2021 22:50:58
    Hello Maurice!

    19 Jun 2021 22:07, Maurice Kinal wrote to Rick Smith:

    Of course you only need to do this when the script is running parallel processes where the output from one is needed for another.

    Life is good,

    the problem is life is good :)


    Regards Benny

    ... too late to die young :)

    --- Msged/LNX 6.1.2 (Linux/5.12.12-gentoo-dist (x86_64))
    * Origin: I will always keep a PC running CPM 3.0 (2:230/0)
  • From Maurice Kinal@1:153/7001 to Benny Pedersen on Sunday, June 20, 2021 00:39:56
    -={ 2021-06-20 00:39:56.788341964+00:00 }=-

    Hey Benny!

    the problem is life is good :)

    And that is bad?

    Life is good,
    Maurice

    ... Meotud ana wat hwær se cwealm cymeþ, þe heonon of cyþþe gewiteþ.
    Only God knows where plague goes when it departs from a place.
    --- GNU bash, version 5.1.8(1)-release (x86_64-motorshed-linux-gnu)
    * Origin: Little Mikey's Brain - Ladysmith BC, Canada (1:153/7001)
  • From Kai Richter@2:240/77 to Rick Smith on Sunday, June 20, 2021 02:08:44
    Hello Rick!

    19 Jun 21, Rick Smith wrote to All:

    trying to make bash script to combine a couple of other scripts

    bash plus bash or bash plus non-bash scripts??

    If I make a script that performs something and then it calls say
    another script, would the first script then pause until the called
    side script completes?

    Yes. A script is basically a list of commands running in sequence one by one.

    ls A*
    ls B*

    would list all files with A* and then all files with B*.

    A command is basically an executable programm or another script.

    Many shells have internal commands for workflow control like loops and breaks.

    If not is there a way to make it wait to move
    forward until the other one completes?

    Yes. On many conditions.

    man bash
    man test

    should be your friend. Take your time and use the search function of man and type /loop for example. Jump with n to the next hit. Or press h for the help file.

    Regards

    Kai

    --- GoldED+/LNX 1.1.4.7
    * Origin: Monobox (2:240/77)
  • From Scott Mcleod@1:103/705 to Benny Pedersen on Sunday, June 20, 2021 11:50:00
    Benny Pedersen wrote to Rick Smith <=-

    @MSGID: <60CE3BB9.48469.linux@vert.synchro.net>
    @REPLY: <60CE388A.48468.linux@vert.synchro.net>
    Hello Rick!

    19 Jun 2021 11:30, Rick Smith wrote to All:

    completes? If not is there a way to make it wait to move forward
    until the other one completes? I hope I
    am describing this well for you.

    bash start_end_off_world.sh && bash stop_end_off_world.sh

    ?

    if start_end_off_world.sh will not end, then the 2nd
    stop_end_off_world.sh will not be called

    hopefully more linux geeks can stop it :)

    Calling another script is just like calling another program. It
    will wait for it to finish before continuing unless you run it in
    the backgound.

    Regards Benny

    ... too late to die young :)

    --- Msged/LNX 6.1.2 (Linux/5.12.12-gentoo-dist (x86_64))
    * Origin: I will always keep a PC running CPM 3.0 (2:230/0)

    --- MultiMail/Win v0.52
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Benny Pedersen@2:230/0 to Maurice Kinal on Thursday, June 24, 2021 23:04:04
    Hello Maurice!

    20 Jun 2021 00:39, Maurice Kinal wrote to Benny Pedersen:

    the problem is life is good :)
    And that is bad?

    no the worst is when there is nothing good


    Regards Benny

    ... too late to die young :)

    --- Msged/LNX 6.1.2 (Linux/5.12.12-gentoo-dist (x86_64))
    * Origin: I will always keep a PC running CPM 3.0 (2:230/0)
  • From Benny Pedersen@2:230/0 to Kai Richter on Thursday, June 24, 2021 23:05:44
    Hello Kai!

    20 Jun 2021 02:08, Kai Richter wrote to Rick Smith:

    ls A*

    results loosed after displayed

    ls B*

    same here

    ls A* >result
    ls B* >>result

    cat result

    = create file with result
    = append file with result

    would list all files with A* and then all files with B*.

    +1


    Regards Benny

    ... too late to die young :)

    --- Msged/LNX 6.1.2 (Linux/5.12.12-gentoo-dist (x86_64))
    * Origin: I will always keep a PC running CPM 3.0 (2:230/0)
  • From Maurice Kinal@1:153/7001 to Benny Pedersen on Friday, June 25, 2021 02:32:36
    -={ 2021-06-25 02:32:36.940042246+00:00 }=-

    Hey Benny!

    no the worst is when there is nothing good

    You must be thinking about an MS echoarea.

    Life is good,
    Maurice

    ... Wyrd byð swiðost... sumor sunwlitegost, swegel byð hatost.
    Fate is the strongest thing... summer sun-fairest, the sun is hottest.
    --- GNU bash, version 5.1.8(1)-release (x86_64-motorshed-linux-gnu)
    * Origin: Little Mikey's Brain - Ladysmith BC, Canada (1:153/7001)
  • From Benny Pedersen@2:230/0 to Maurice Kinal on Saturday, June 26, 2021 13:57:40
    Hello Maurice!

    25 Jun 2021 02:32, Maurice Kinal wrote to Benny Pedersen:

    no the worst is when there is nothing good
    You must be thinking about an MS echoarea.

    one day gentoo users emerge windows :)

    microsoft-edge is already in gentoo portage, dont know why i want it


    Regards Benny

    ... too late to die young :)

    --- Msged/LNX 6.1.2 (Linux/5.12.13-gentoo-dist (x86_64))
    * Origin: I will always keep a PC running CPM 3.0 (2:230/0)
  • From Maurice Kinal@1:153/7001 to Benny Pedersen on Saturday, June 26, 2021 14:33:48
    -={ 2021-06-26 14:33:48.861326583+00:00 }=-

    Hey Benny!

    one day gentoo users emerge windows :)

    -1

    microsoft-edge is already in gentoo portage, dont know why i
    want it

    I've never seen it. Is there a text version (ala lynx)? :::snicker:::

    Life is good,
    Maurice

    ... Wyrd oft nereð unfægne eorl þonne his ellen deah.
    Fate often saves an undoomed man, when his courage is good.
    --- GNU bash, version 5.1.8(1)-release (x86_64-motorshed-linux-gnu)
    * Origin: Little Mikey's Brain - Ladysmith BC, Canada (1:153/7001)
  • From Alan Ianson@1:153/757.3 to Benny Pedersen on Saturday, June 26, 2021 07:59:12
    one day gentoo users emerge windows :)

    microsoft-edge is already in gentoo portage, dont know why i want it

    I don't think that's what you want .. ;)

    --- BBBS/Li6 v4.10 Toy-5
    * Origin: The Rusty MailBox - Penticton, BC Canada (1:153/757.3)
  • From Kai Richter@2:240/77 to Benny Pedersen on Saturday, June 26, 2021 06:54:16
    Hello Benny!

    24 Jun 21, Benny Pedersen wrote to Kai Richter:

    = create file with result
    = append file with result

    Really? This looks confusing to me now.

    Take your time and use the search function of man and type /loop for example. Jump with n to the next hit. Or press h for the help file.

    Well, jump with n is not a man search function. man used less to display text on my system so n is a search function of less.

    Regards

    Kai

    --- GoldED+/LNX 1.1.4.7
    * Origin: Monobox (2:240/77)
  • From Brian Rogers@1:142/103 to Kai Richter on Saturday, June 26, 2021 14:52:00
    Hello Kai;

    Kai Richter wrote to Benny Pedersen <=-

    I'll wrap the two in brackets so an offline quote won't confuse you.

    { cat file > results.txt } write the results of "cat file" to results.txt
    as a NEW file.

    {cat file2 >> results.txt } -appends- the results of "cat file2" to results.txt
    which follows the results of "cat file".



    ... Help, I've fallen and I can't reach my keybd
    --- MultiMail/Linux v0.52
    * Origin: SBBS - Carnage! Hartford, Ct (1:142/103)
  • From Benny Pedersen@2:230/0 to Maurice Kinal on Sunday, June 27, 2021 09:24:28
    Hello Maurice!

    26 Jun 2021 14:33, Maurice Kinal wrote to Benny Pedersen:

    one day gentoo users emerge windows :)
    -1

    its actuly fun

    microsoft-edge is already in gentoo portage, dont know why i
    want it
    I've never seen it. Is there a text version (ala lynx)?
    :::snicker:::

    should not need to test :)

    it could just be fun to see diff for chrome / edge, to see what virus is buildt-in


    Regards Benny

    ... too late to die young :)

    --- Msged/LNX 6.1.2 (Linux/5.12.13-gentoo-dist (x86_64))
    * Origin: I will always keep a PC running CPM 3.0 (2:230/0)
  • From Benny Pedersen@2:230/0 to Alan Ianson on Sunday, June 27, 2021 09:27:30
    Hello Alan!

    26 Jun 2021 07:59, Alan Ianson wrote to Benny Pedersen:

    one day gentoo users emerge windows :)
    microsoft-edge is already in gentoo portage, dont know why i want it
    I don't think that's what you want .. ;)

    need to be tested to know it ....


    Regards Benny

    ... too late to die young :)

    --- Msged/LNX 6.1.2 (Linux/5.12.13-gentoo-dist (x86_64))
    * Origin: I will always keep a PC running CPM 3.0 (2:230/0)
  • From Alan Ianson@1:153/757.3 to Benny Pedersen on Sunday, June 27, 2021 02:51:16
    one day gentoo users emerge windows :)
    microsoft-edge is already in gentoo portage, dont know why i want it
    I don't think that's what you want .. ;)

    need to be tested to know it ....

    I suppose something like that might just need to be tested.

    It's been a long time since I sat down at a windows computer and I don't think I've ever had a look at edge.

    Let me know the results of your testing.. :)

    --- BBBS/Li6 v4.10 Toy-5
    * Origin: The Rusty MailBox - Penticton, BC Canada (1:153/757.3)
  • From Maurice Kinal@1:153/7001 to Benny Pedersen on Sunday, June 27, 2021 17:18:17
    -={ 2021-06-27 17:18:17.678332880+00:00 }=-

    Hey Benny!

    Is there a text version (ala lynx)?

    should not need to test :)

    -1

    In other words, no there isn't. The above answer sounds too much like a cop out.

    it could just be fun to see diff for chrome / edge, to see what
    virus is buildt-in

    I'll wait for the movie to come out. Speaking of which, H.265?

    Life is good,
    Maurice

    ... Ciggendra gehwilc wile þæt hine man gehere.
    Everyone who shouts out wants to be heard.
    --- GNU bash, version 5.1.8(1)-release (x86_64-motorshed-linux-gnu)
    * Origin: Little Mikey's Brain - Ladysmith BC, Canada (1:153/7001)
  • From Benny Pedersen@2:230/0 to Maurice Kinal on Sunday, June 27, 2021 18:11:14
    Hello Maurice!

    27 Jun 2021 17:18, Maurice Kinal wrote to Benny Pedersen:

    In other words, no there isn't. The above answer sounds too much like
    a cop out.

    ----- edge-dev.txt begins -----
    * www-client/microsoft-edge-dev
    Available versions: ~93.0.910.5^msd ~93.0.916.1^msd ~93.0.926.1^msd
    IUSE (all versions): KERNEL="linux"
    Homepage: https://www.microsoft.com/en-us/edge
    Find open bugs: https://bugs.gentoo.org/buglist.cgi?quicksearch=www-client%2Fmicrosoft-edge-dev
    Description: The web browser from Microsoft
    License: microsoft-edge

    ----- edge-dev.txt ends -----

    ----- edge-beta.txt begins -----
    * www-client/microsoft-edge-beta
    Available versions: ~92.0.902.9^msd ~92.0.902.15^msd ~92.0.902.22^msd
    IUSE (all versions): KERNEL="linux"
    Homepage: https://www.microsoft.com/en-us/edge
    Find open bugs: https://bugs.gentoo.org/buglist.cgi?quicksearch=www-client%2Fmicrosoft-edge-beta
    Description: The web browser from Microsoft
    License: microsoft-edge

    ----- edge-beta.txt ends -----

    need license to kill first :)

    it could just be fun to see diff for chrome / edge, to see what
    virus is buildt-in

    I'll wait for the movie to come out. Speaking of which, H.265?

    how did it go ?


    Regards Benny

    ... too late to die young :)

    --- Msged/LNX 6.1.2 (Linux/5.12.13-gentoo-dist (x86_64))
    * Origin: I will always keep a PC running CPM 3.0 (2:230/0)
  • From Maurice Kinal@1:153/7001 to Benny Pedersen on Sunday, June 27, 2021 19:02:12
    -={ 2021-06-27 19:02:12.258343940+00:00 }=-

    Hey Benny!

    need license to kill first :)

    What is wrong with xkill? I believe it is opensource.

    I'll wait for the movie to come out. Speaking of which, H.265?

    how did it go ?

    It hasn't come out yet. Rumour has it that they are having trouble finding a suitable actor to play Batman.

    Life is good,
    Maurice

    ... Til sceal on eðle domes wyrcean.
    A good man should earn glory in his homeland.
    --- GNU bash, version 5.1.8(1)-release (x86_64-motorshed-linux-gnu)
    * Origin: Little Mikey's Brain - Ladysmith BC, Canada (1:153/7001)
  • From Benny Pedersen@2:230/0 to Maurice Kinal on Sunday, June 27, 2021 19:37:54
    Hello Maurice!

    27 Jun 2021 19:02, Maurice Kinal wrote to Benny Pedersen:

    need license to kill first :)
    What is wrong with xkill? I believe it is opensource.

    it cant kill microsoft-edge license, so you need xkill licensed to microsoft-edge to do this :)

    I'll wait for the movie to come out. Speaking of which, H.265?
    how did it go ?
    It hasn't come out yet. Rumour has it that they are having trouble finding a suitable actor to play Batman.

    back to toy story 4


    Regards Benny

    ... too late to die young :)

    --- Msged/LNX 6.1.2 (Linux/5.12.13-gentoo-dist (x86_64))
    * Origin: I will always keep a PC running CPM 3.0 (2:230/0)
  • From Maurice Kinal@1:153/7001 to Benny Pedersen on Sunday, June 27, 2021 19:50:12
    -={ 2021-06-27 19:50:12.859528347+00:00 }=-

    Hey Benny!

    it cant kill microsoft-edge license, so you need xkill licensed
    to microsoft-edge to do this :)

    https://answers.microsoft.com/en-us/windows/forum/all/is-there-a-windows-equivalent-to-the-linux-xkill/31e6ea41-f865-41c3-8df4-ae23d43d9773

    Pretty sad but I suppose that was my original observation about all things microsoft ... although I used the word bad instead of sad.

    back to toy story 4

    That might be better. They could get Mr. Potato Head to play Bill Gates.

    Life is good,
    Maurice

    ... Sorh cymeð manig ond mislic in manna dream.
    Sorrow comes in many and various ways amid the joys of men.
    --- GNU bash, version 5.1.8(1)-release (x86_64-motorshed-linux-gnu)
    * Origin: Little Mikey's Brain - Ladysmith BC, Canada (1:153/7001)