View Issue Details

IDProjectCategoryView StatusLast Update
00002351003.1(2008)/Issue 7Shell and Utilitiespublic2013-04-16 13:06
Reportergeoffclare Assigned Toajosey  
PrioritynormalSeverityCommentTypeError
Status ClosedResolutionAccepted 
NameGeoff Clare
OrganizationThe Open Group
User Reference
Sectionfind
Page Number2743
Line Number89314-89317
Interp Status---
Final Accepted Text
Summary0000235: correction/improvement of find example 8
DescriptionIn austin-group-l 11797 Stephane Chazelas wrote:
 >
 > SUSv4> 8. The following command:
 > SUSv4>
 > SUSv4> find . ! -name . -prune -name '*.old' -exec \
 > SUSv4> sh -c 'mv "$@" ../old/' sh {} +
 > SUSv4>
 > SUSv4> performs the same task as:
 > SUSv4>
 > SUSv4> mv ./*.old ./.*.old ../old/
 >
 > I'd say it performs the same task as:
 >
 > mv ./*.old ./.*.old ./.old ../old/
 >
 > (that is, it also moves a file called ".old" if it exists)
 > without causing mv to output error messages when patterns don't
 > match, and without running mv if there aren't any matching
 > files
Desired ActionChange

    mv ./*.old ./.*.old ../old/

    while avoiding an "Argument list too long" error if there are a
    large number of files ending with .old (and avoiding "No such file
    or directory" errors if no files match ./*.old or ./.*.old).

to

    mv ./*.old ./.old ./.*.old ../old/

    while avoiding an "Argument list too long" error if there are a
    large number of files ending with .old and without running mv if
    there are no such files (and avoiding "No such file or directory"
    errors if ./.old does not exist or no files match ./*.old or
    ./.*.old).
Tagstc1-2008

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2010-04-01 09:24 geoffclare New Issue
2010-04-01 09:24 geoffclare Status New => Under Review
2010-04-01 09:24 geoffclare Assigned To => ajosey
2010-04-01 09:24 geoffclare Name => Geoff Clare
2010-04-01 09:24 geoffclare Organization => The Open Group
2010-04-01 09:24 geoffclare Section => find
2010-04-01 09:24 geoffclare Page Number => 2743
2010-04-01 09:24 geoffclare Line Number => 89314-89317
2010-04-01 09:24 geoffclare Interp Status => ---
2010-04-15 16:08 Don Cragun Status Under Review => Resolved
2010-04-15 16:08 Don Cragun Resolution Open => Accepted
2010-08-27 11:24 ajosey Tag Attached: tc1-2008
2013-04-16 13:06 ajosey Status Resolved => Closed