Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 37

Thread: Shell/bash

  1. #11
    Join Date
    Jun 2011
    Beans
    64

    Question Re: Shell/bash

    Ok, so Shell or Bash? All the scripts I've been using (based on what I was taught through a couple of books) told me to "ALWAYS" use that beginning. What's the difference?

    And aside from that, I'm still not exactly wrong with the script. It worked just fine about two or three years ago... I install updates and it's not working? I'm not sure what exactly the problem is to begin with; I don't know what the right question is for that matter!

    Edited to add this:

    And even using "bash extract.sh" in my terminal the end result is still the same, regardless...
    Last edited by rhss6-2011; August 12th, 2014 at 04:25 AM.
    Loneliness is never more cruel than when it is felt in close propinquity with someone who has ceased to communicate.

  2. #12
    Join Date
    Jul 2007
    Location
    Poland
    Beans
    4,460
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Shell/bash

    #!/bin/bash literally says "please use /bin/bash program to interpret this file".
    If you have executable bit set, ./script to run is enough because system figures things out from #!. If you call shell explicitly, you override the header of the file.
    There are different kinds of shells with common basics but with different feature sets.
    That debug.sh: redirection unexpected in the screenshot is barebone sh/dash failing at bash only feature.


    so what happens when you replace 02 block with papibe's suggestion #2, #3 or #4 ( while read ... done < <( find ... ) )
    btw, add something like echo "'$r'" inside the loop to print out values of r to confirm that proper paths are passed.
    Last edited by Vaphell; August 12th, 2014 at 07:00 AM.
    if your question is answered, mark the thread as [SOLVED]. Thx.
    To post code or command output, use [code] tags.
    Check your bash script here // BashFAQ // BashPitfalls

  3. #13
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    7,076
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Shell/bash

    We are getting close.

    I believe there are a rar file in the folder you are executing the script, as only one file is found.

    Please run again the debug script, but now in only one of these two ways:
    Code:
    bash ./debug.sh /path/to/downloads
    or
    Code:
    chmod a+x ./debug.sh
    ./debug.sh /path/to/downloads
    (replace /path/to/downloads with the actual path to the download directory).

    BTW you can copy/paste the text from the terminal to post the results.
    Regards.

  4. #14
    Join Date
    Jun 2011
    Beans
    64

    Re: Shell/bash

    Same output as before...

    Code:
    stephen@UNSC:/mnt/DATA/Downloads/01-TORRENTS/01-Downloaded$ bash ./debug.sh /mnt/DATA/Downloads/01-TORRENTS/01-Downloaded/
    ----------------------------------------------
    find /mnt/DATA/Downloads/01-TORRENTS/01-Downloaded/ -wholename *.rar
    Files found: 1
    
    
    ----------------------------------------------
    find /mnt/DATA/Downloads/01-TORRENTS/01-Downloaded/ -iname *.rar
    Files found: 1
    
    
    ----------------------------------------------
    find /mnt/DATA/Downloads/01-TORRENTS/01-Downloaded/ -type f -iname '*.rar'
    Files found: 1
    
    
    ----------------------------------------------
    while IFS...
    Files found: 1
    
    
    stephen@UNSC:/mnt/DATA/Downloads/01-TORRENTS/01-Downloaded$

    The main issue here, is that it's only recognizing "ONE" rar file (or set of files) to extract when it should be recognizing one in EVERY sub-folder as shown in the screenshot. The folder in which I have the two scripts DOESN'T have any files to extract - just the sub-folders...
    Loneliness is never more cruel than when it is felt in close propinquity with someone who has ceased to communicate.

  5. #15
    Join Date
    Jul 2007
    Location
    Poland
    Beans
    4,460
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Shell/bash

    to be honest i don't see any *.rar file in the screenshot, it's all numbers and sfv
    if your question is answered, mark the thread as [SOLVED]. Thx.
    To post code or command output, use [code] tags.
    Check your bash script here // BashFAQ // BashPitfalls

  6. #16
    Join Date
    Jun 2011
    Beans
    64

    Re: Shell/bash

    That's just because it doesn't show.

    Here's a breakdown - r.00, r.01, r.02 etc. belong together. They're all rar files. My script (in the past) recursively looked for those files in the subfolder and extracted them either for a video, or ISO image. If one of the rars are missing I can't get the file completely extracted. That was the whole point of the script. It'd go into the subfolder and extract the files until EVERY folder was completely finished.

    Now it finds the first set, and then after extraction it stops.
    Loneliness is never more cruel than when it is felt in close propinquity with someone who has ceased to communicate.

  7. #17
    Join Date
    Aug 2010
    Location
    Lancs, United Kingdom
    Beans
    1,166
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Shell/bash

    Please post the output of:
    Code:
    find /mnt/DATA/Downloads/01-TORRENTS/01-Downloaded
    ls -laR /mnt/DATA/Downloads/01-TORRENTS/01-Downloaded

  8. #18
    Join Date
    Jul 2007
    Location
    Poland
    Beans
    4,460
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Shell/bash

    That's just because it doesn't show.
    why would that be the case? It's not a hidden filetype. Occam bets 20 bucks and his razor that there is no rar file as in characters 'r' 'a' 'r'.
    if your question is answered, mark the thread as [SOLVED]. Thx.
    To post code or command output, use [code] tags.
    Check your bash script here // BashFAQ // BashPitfalls

  9. #19
    Join Date
    Jun 2011
    Beans
    64

    Re: Shell/bash

    It's been that way for years. EVERY torrent download I've seen from my friends, and my father included use rar files in that manner - why, I don't know nor do I really care and the point of this thread isn't really to discuss the validity of how people create/download torrents.

    I'm trying to get help on fixing my (now outdated, apparently...) script.
    Loneliness is never more cruel than when it is felt in close propinquity with someone who has ceased to communicate.

  10. #20
    Join Date
    Jun 2011
    Beans
    64

    Re: Shell/bash

    And as far as your "bet" is concerned... Here's a thumbnail.
    Attached Images Attached Images
    Loneliness is never more cruel than when it is felt in close propinquity with someone who has ceased to communicate.

Page 2 of 4 FirstFirst 1234 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •