Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Multiple "for x do" - commands in one script?

  1. #11
    Join Date
    Jul 2007
    Location
    Poland
    Beans
    4,499
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Multiple "for x do" - commands in one script?

    sure Command line is good, but the scripts make it feel like I can memorize the commands without having to rewrite them each time.
    i am not sure i get the distinction, you can run premade scripts from command line just fine and make them as universal as you please. The only difference between running them from terminal and from n-a is the additional requirement of making them compatible with n-a or else they fail completely.

    so what do you pass to the script: files you select or dir/current dir because that is still not clear to me.

  2. #12
    Join Date
    Sep 2011
    Beans
    180
    Distro
    Ubuntu

    Re: Multiple "for x do" - commands in one script?

    Quote Originally Posted by Vaphell View Post
    i am not sure i get the distinction, you can run premade scripts from command line just fine and make them as universal as you please. The only difference between running them from terminal and from n-a is the additional requirement of making them compatible with n-a or else they fail completely.

    so what do you pass to the script: files you select or dir/current dir because that is still not clear to me.
    Well if the files I select can be MULTIPLE files, and the script can process as many of the files I select, then lets go with that option for the script.

    If it can only handle 1 file at a time, then lets go with the dir/current half of the script.

  3. #13
    Join Date
    Jul 2007
    Location
    Poland
    Beans
    4,499
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Multiple "for x do" - commands in one script?

    as i said script can do whatever you want, it's you who is the bawss here, not the script

    still i haven't found out what your current config is -_-
    how is your nautilus-action entry set up? what did you put in command/parameters/working dir fields? %d? %F? i won't mind if you tell me what the descriptions of these placeholders are (legend window)

    in your current script put that line:
    Code:
    for f in "$@"; do echo "$f"; done > /home/yourname/debug.txt
    and after triggering your action from nautilus on few files open that debug.txt, because i really want to know what the script gets from n-a. Without it we will be going in circles unproductively and my patience will run out.
    In my virtualboxed 11.04 files dumped to debug text file get %20 in place of spaces and that requires additional line of code or two. Is that the case on your system too?
    Last edited by Vaphell; April 24th, 2012 at 08:12 PM.

  4. #14
    Join Date
    Sep 2011
    Beans
    180
    Distro
    Ubuntu

    Re: Multiple "for x do" - commands in one script?

    Quote Originally Posted by Vaphell View Post
    as i said script can do whatever you want, it's you who is the bawss here, not the script

    still i haven't found out what your current config is -_-
    how is your nautilus-action entry set up? what did you put in command/parameters/working dir fields? %d? %F? i won't mind if you tell me what the descriptions of these placeholders are (legend window)

    in your current script put that line:
    Code:
    for f in "$@"; do echo "$f"; done > /home/yourname/debug.txt
    and after triggering your action from nautilus on few files open that debug.txt, because i really want to know what the script gets from n-a. Without it we will be going in circles unproductively and my patience will run out.
    In my virtualboxed 11.04 files dumped to debug text file get %20 in place of spaces and that requires additional line of code or two. Is that the case on your system too?
    how do I test out what my nautilus actions are - all I do is go:

    Code:
    cp scriptnamehere.sh ~/.gnome2/nautilus-scripts/
    then I cd into the directory and apply
    Code:
    chmod +x scriptnamehere.sh
    Last edited by AlexOnVinyl; April 27th, 2012 at 05:39 AM.

Page 2 of 2 FirstFirst 12

Tags for this Thread

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
  •