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

 
 

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

Submitted by:  None
Submitted on:  Mon 25 Sep 2017 02:49:29 AM UTC  
 
Category: NonePriority: 5 - Normal
Severity: 2 - MinorStatus: None
Privacy: PublicAssigned to: None
Originator Email: -unavailable-Open/Closed: Open
Operating System: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project 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 File(s):
   
   
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
  • -unavailable- added by dezperado (Updated the item)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 30 Sep 2017 03:02:28 PM UTCdezperadoAttached File-=>Added 109387.log, #42016

    Back to the top


    Powered by Savane 3.1-cleanup1