piping the list of files to a custom command line [on hold]












0















If I right-click on a file in pcmanfm, then select Open With -> Open With and then click on the "Custom Command Line" tab it gives me a place to enter a command line to execute. I can use %F as an argument to this command where it will put all files selected when I run this new command.



However, there is a limit on how long a command line can be. On my system it is 2MB, but my understanding is it could be as low as 32kB. The full path to each file that is selected when my command is run is passed. It is not unusual for the length of each argument to be over 100 characters. This effectively limits file actions to under 20,000 files on average for my system.



There are also cases where I can easily construct a command line that takes a list of input files on stdin but not the command line. But I can't include something like for I in %F; do echo $I; done | in the command line for pcmanfm, this causes my "open with" entry to fail to show up in the menu. Instead, I have to create a new script file and put this in front of the command to run, adding an additional step.



Is there some way to pipe the list of files directly to the command I am creating, bypassing the need and limitation of passing them as command line arguments?










share|improve this question















put on hold as unclear what you're asking by dessert, George Udosen, Eric Carvalho, Thomas, waltinator Jan 15 at 23:11


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
















  • I don't really understand what you are trying to do. Is this a question about scripting or about pcmanfm or both? Could you maybe edit your question and add an example? Why would you need to get each file name as a separate argument in your script? Why is piping hard?

    – terdon
    Jan 2 at 18:49











  • @terdon Ok, maybe "hard" is a relative term. I have rewritten my question. Maybe pcmanfm simply doesn't provide a way to do this, in which case I should just delete my question and (not) gripe at the pcmanfm developers ---for their shortsidedness---.

    – Michael
    Jan 2 at 22:07













  • Thanks for the edit, that's clearer. It would probably be best if you could give an example of the sort of thing that fails that we can reproduce. I haven't used a file manager in almost 20 years, can you really operate on 20000 files? Doesn't it make more sense to just do it from the command-line directly? You seem to know your way around the CLI, so why try to use a tool which is less suited (IMO) to the task? I'm guessing the GUI is giving you some specific feature you found useful, but I don't understand what from your question.

    – terdon
    Jan 2 at 22:41
















0















If I right-click on a file in pcmanfm, then select Open With -> Open With and then click on the "Custom Command Line" tab it gives me a place to enter a command line to execute. I can use %F as an argument to this command where it will put all files selected when I run this new command.



However, there is a limit on how long a command line can be. On my system it is 2MB, but my understanding is it could be as low as 32kB. The full path to each file that is selected when my command is run is passed. It is not unusual for the length of each argument to be over 100 characters. This effectively limits file actions to under 20,000 files on average for my system.



There are also cases where I can easily construct a command line that takes a list of input files on stdin but not the command line. But I can't include something like for I in %F; do echo $I; done | in the command line for pcmanfm, this causes my "open with" entry to fail to show up in the menu. Instead, I have to create a new script file and put this in front of the command to run, adding an additional step.



Is there some way to pipe the list of files directly to the command I am creating, bypassing the need and limitation of passing them as command line arguments?










share|improve this question















put on hold as unclear what you're asking by dessert, George Udosen, Eric Carvalho, Thomas, waltinator Jan 15 at 23:11


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
















  • I don't really understand what you are trying to do. Is this a question about scripting or about pcmanfm or both? Could you maybe edit your question and add an example? Why would you need to get each file name as a separate argument in your script? Why is piping hard?

    – terdon
    Jan 2 at 18:49











  • @terdon Ok, maybe "hard" is a relative term. I have rewritten my question. Maybe pcmanfm simply doesn't provide a way to do this, in which case I should just delete my question and (not) gripe at the pcmanfm developers ---for their shortsidedness---.

    – Michael
    Jan 2 at 22:07













  • Thanks for the edit, that's clearer. It would probably be best if you could give an example of the sort of thing that fails that we can reproduce. I haven't used a file manager in almost 20 years, can you really operate on 20000 files? Doesn't it make more sense to just do it from the command-line directly? You seem to know your way around the CLI, so why try to use a tool which is less suited (IMO) to the task? I'm guessing the GUI is giving you some specific feature you found useful, but I don't understand what from your question.

    – terdon
    Jan 2 at 22:41














0












0








0








If I right-click on a file in pcmanfm, then select Open With -> Open With and then click on the "Custom Command Line" tab it gives me a place to enter a command line to execute. I can use %F as an argument to this command where it will put all files selected when I run this new command.



However, there is a limit on how long a command line can be. On my system it is 2MB, but my understanding is it could be as low as 32kB. The full path to each file that is selected when my command is run is passed. It is not unusual for the length of each argument to be over 100 characters. This effectively limits file actions to under 20,000 files on average for my system.



There are also cases where I can easily construct a command line that takes a list of input files on stdin but not the command line. But I can't include something like for I in %F; do echo $I; done | in the command line for pcmanfm, this causes my "open with" entry to fail to show up in the menu. Instead, I have to create a new script file and put this in front of the command to run, adding an additional step.



Is there some way to pipe the list of files directly to the command I am creating, bypassing the need and limitation of passing them as command line arguments?










share|improve this question
















If I right-click on a file in pcmanfm, then select Open With -> Open With and then click on the "Custom Command Line" tab it gives me a place to enter a command line to execute. I can use %F as an argument to this command where it will put all files selected when I run this new command.



However, there is a limit on how long a command line can be. On my system it is 2MB, but my understanding is it could be as low as 32kB. The full path to each file that is selected when my command is run is passed. It is not unusual for the length of each argument to be over 100 characters. This effectively limits file actions to under 20,000 files on average for my system.



There are also cases where I can easily construct a command line that takes a list of input files on stdin but not the command line. But I can't include something like for I in %F; do echo $I; done | in the command line for pcmanfm, this causes my "open with" entry to fail to show up in the menu. Instead, I have to create a new script file and put this in front of the command to run, adding an additional step.



Is there some way to pipe the list of files directly to the command I am creating, bypassing the need and limitation of passing them as command line arguments?







pipe pcmanfm






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 2 at 22:06







Michael

















asked Jan 2 at 18:19









MichaelMichael

2611312




2611312




put on hold as unclear what you're asking by dessert, George Udosen, Eric Carvalho, Thomas, waltinator Jan 15 at 23:11


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






put on hold as unclear what you're asking by dessert, George Udosen, Eric Carvalho, Thomas, waltinator Jan 15 at 23:11


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.















  • I don't really understand what you are trying to do. Is this a question about scripting or about pcmanfm or both? Could you maybe edit your question and add an example? Why would you need to get each file name as a separate argument in your script? Why is piping hard?

    – terdon
    Jan 2 at 18:49











  • @terdon Ok, maybe "hard" is a relative term. I have rewritten my question. Maybe pcmanfm simply doesn't provide a way to do this, in which case I should just delete my question and (not) gripe at the pcmanfm developers ---for their shortsidedness---.

    – Michael
    Jan 2 at 22:07













  • Thanks for the edit, that's clearer. It would probably be best if you could give an example of the sort of thing that fails that we can reproduce. I haven't used a file manager in almost 20 years, can you really operate on 20000 files? Doesn't it make more sense to just do it from the command-line directly? You seem to know your way around the CLI, so why try to use a tool which is less suited (IMO) to the task? I'm guessing the GUI is giving you some specific feature you found useful, but I don't understand what from your question.

    – terdon
    Jan 2 at 22:41



















  • I don't really understand what you are trying to do. Is this a question about scripting or about pcmanfm or both? Could you maybe edit your question and add an example? Why would you need to get each file name as a separate argument in your script? Why is piping hard?

    – terdon
    Jan 2 at 18:49











  • @terdon Ok, maybe "hard" is a relative term. I have rewritten my question. Maybe pcmanfm simply doesn't provide a way to do this, in which case I should just delete my question and (not) gripe at the pcmanfm developers ---for their shortsidedness---.

    – Michael
    Jan 2 at 22:07













  • Thanks for the edit, that's clearer. It would probably be best if you could give an example of the sort of thing that fails that we can reproduce. I haven't used a file manager in almost 20 years, can you really operate on 20000 files? Doesn't it make more sense to just do it from the command-line directly? You seem to know your way around the CLI, so why try to use a tool which is less suited (IMO) to the task? I'm guessing the GUI is giving you some specific feature you found useful, but I don't understand what from your question.

    – terdon
    Jan 2 at 22:41

















I don't really understand what you are trying to do. Is this a question about scripting or about pcmanfm or both? Could you maybe edit your question and add an example? Why would you need to get each file name as a separate argument in your script? Why is piping hard?

– terdon
Jan 2 at 18:49





I don't really understand what you are trying to do. Is this a question about scripting or about pcmanfm or both? Could you maybe edit your question and add an example? Why would you need to get each file name as a separate argument in your script? Why is piping hard?

– terdon
Jan 2 at 18:49













@terdon Ok, maybe "hard" is a relative term. I have rewritten my question. Maybe pcmanfm simply doesn't provide a way to do this, in which case I should just delete my question and (not) gripe at the pcmanfm developers ---for their shortsidedness---.

– Michael
Jan 2 at 22:07







@terdon Ok, maybe "hard" is a relative term. I have rewritten my question. Maybe pcmanfm simply doesn't provide a way to do this, in which case I should just delete my question and (not) gripe at the pcmanfm developers ---for their shortsidedness---.

– Michael
Jan 2 at 22:07















Thanks for the edit, that's clearer. It would probably be best if you could give an example of the sort of thing that fails that we can reproduce. I haven't used a file manager in almost 20 years, can you really operate on 20000 files? Doesn't it make more sense to just do it from the command-line directly? You seem to know your way around the CLI, so why try to use a tool which is less suited (IMO) to the task? I'm guessing the GUI is giving you some specific feature you found useful, but I don't understand what from your question.

– terdon
Jan 2 at 22:41





Thanks for the edit, that's clearer. It would probably be best if you could give an example of the sort of thing that fails that we can reproduce. I haven't used a file manager in almost 20 years, can you really operate on 20000 files? Doesn't it make more sense to just do it from the command-line directly? You seem to know your way around the CLI, so why try to use a tool which is less suited (IMO) to the task? I'm guessing the GUI is giving you some specific feature you found useful, but I don't understand what from your question.

– terdon
Jan 2 at 22:41










0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Quarter-circle Tiles

build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

Mont Emei