mainFIM: Fbi IMproved - Support: sr #109387, Consider clarifying the ! (run...

 
 

sr #109387: Consider clarifying the ! (run system command) in documentation

Submitter:  None
Submitted:  Mon 25 Sep 2017 02:49:29 AM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  2 - Minor Status:  None
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Open
Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 30 Sep 2017 03:02:28 PM UTC, comment #1: 

Hi.

thank you for appreciating and caring!
You are right, "!" (an alias to fim's internal "system" command) is not well documented.

I improved this a bit now in fim 0.5 and trunk (svn repo only, revision 1500), as in the following diff:

-!{syscmd}              executes the {syscmd} quoted string as a "/bin/sh" shell command
+!{syscmd}              executes the {syscmd} quoted string as an argument to the  "system" fim command.
 
-system {syscmd}: get the output of the shell command {syscmd}. (uses popen()).
+system {syscmd}: get the output of executing the {syscmd} system command. Uses the popen() system call. Usually popen invokes "/bin/sh \-c {syscmd}". This might not handle a multi\-word command; in that case you will have to put it into a script. See 'man popen' for more.

Please let me know if it is ok now, or let me know how to improve it.


(file #42016)

dezperado <dezperado>
Group administrator
Mon 25 Sep 2017 02:49:29 AM UTC, original submission:  

Hi,

#1 Great program!

#2 I spent a while trying to debug why a cmdline like:

fim -c 'bottom-align;toggleDisplayStatus;redisplay;!"cp /dev/fb0 /tmp/fim.out";quit' test.jpg

fails with:

sh: cp /dev/fb0 /tmp/fim.out: No such file or directory

Using strace I found fim was calling execve which requires the shell command to be binary executable or a hashbag script file. Since cp is built into most (including bash and dash, maybe all?) shells its not an executable or a hashbang script, so execev fails. The fix for me was to create a hashbang file with the command in it.

I don't consider this a bug, but I think the documentation should clarify that '!' should be followed by what execev expects, not necessarily a shell command.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #42016:  109387.log added by dezperado (1KiB - text/x-log)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dezperado (Updated the item)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-09-30 dezperado Attached File- Added 109387.log, #42016

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code