bugfindutils - Bugs: bug #40648, xargs -t does not show EXACT...

 
 

bug #40648: xargs -t does not show EXACT command line

Submitted by:  None
Submitted on:  Wed 20 Nov 2013 05:06:28 PM UTC  
 
Category: xargsSeverity: 3 - Normal
Item Group: Wrong resultStatus: Works For Me
Privacy: PublicAssigned to: None
Originator Name: Anne van RossumOriginator Email: -unavailable-
Open/Closed: ClosedRelease: None
Fixed Release: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Sun 12 Jan 2014 08:30:31 PM UTC, comment #1:

Shell quoting would probably be misleading though; xargs does not use a shell to launch its commands.

The --quoting-style=shell variant appears to work since, by default, xargs does some quote processing on its input. However this quote processing is not the same as what the shell does, so depending on this is not a safe option for the general case.

In your examples though, I don't think that it's nautilus's fault. The problem is that xargs considers arguments to be separated by spaces. Hence a better way to solve the problem you are describing is this:

$ find . -name "example*" -exec nautilus {} \+

No quoting, shell or otherwise, is needed here to make Nautilus work correctly.

Since xargs only launches a shell if you specify it as the command, I'm not inclined to change the format of the output of "xargs -t" as this would be backward-incompatible and I don't think doing so has a compelling advantage.

Please feel free to re-open the bug if you plan to convince me otherwise.

James Youngman <jay>
Project Administrator
Wed 20 Nov 2013 05:06:28 PM UTC, original submission:

Bug:

To reproduce:

Here "nautilus" is just an example program that does choke on something provided by spaces:

The former option does fail to open with nautilus ("example", "1", and "2" are opened), while the second properly does open nautilus properly.

Expected:

What I would expect as xargs -t output is the following:

So, I would expect it to have the quotes from the ls --quoting-style=shell | grep example command

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jay (Posted a comment)
  • -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):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 12 Jan 2014 08:30:31 PM UTCjayStatusNone=>Works For Me
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup