Comment on GNU grep 2.12 changes behavior of recursion options, breaks existing scriptsparentComments−leif14yYeah, for habitual reasons I usually use -R. No idea why.−lubutu14yIn POSIX -R is the recursion flag for ls, cp, rm, etc. So if you want to recurse, -R is probably a safer bet than -r. (ls -r just lists in reverse.)−buster14yYeah, that may be it.. I'm wondering why they didn't just add a new option (aka --no-symlinks) or something−a3_nm14yAnnoying exception: scp only accepts -r as recursion flag, not -R.−wildmXranat14ySame here. I've been conditioned to use -R−mturmon14yGood point. Also, since you reminded me, chmod, chown, chgrp.−leif14ythat's probably it−adavies4214yever work on a non-gnu box? (old solaris, *bsd, stock os x, etc.) there's a decent chance they don't have -r at all.−cschrammOP14y*BSDs have (=> OS X probably too).Solaris, HP-UX and OpenServer have not.AIX is weird:> -r Searches directories recursively. By default, links to directories are followed.> -R Searches directories recursively. By default, links to directories are not followed.−rbanffy14yIsn't the AIX behavior the one POSIX specifies?−cschrammOP14yLooking at MattJ100's link (http://pubs.opengroup.org/onlinepubs/009695399/utilities/gre...), it seems like POSIX grep actually does not have any recursion.Hence, only lubutu's comment ("-R is the recursion flag for ls, cp, rm, etc") is true, while _delirium ("-R is the POSIX-standard flag for recursive grep") is wrong, which means AIX is free to do whatever it wants with both the -r and the -R flags.−lmm14yThat would be kind of perverse given how cp behaves for -r and -R
Comments
Yeah, for habitual reasons I usually use -R. No idea why.
In POSIX -R is the recursion flag for ls, cp, rm, etc. So if you want to recurse, -R is probably a safer bet than -r. (ls -r just lists in reverse.)
Yeah, that may be it.. I'm wondering why they didn't just add a new option (aka --no-symlinks) or something
Annoying exception: scp only accepts -r as recursion flag, not -R.
Same here. I've been conditioned to use -R
Good point. Also, since you reminded me, chmod, chown, chgrp.
that's probably it
ever work on a non-gnu box? (old solaris, *bsd, stock os x, etc.) there's a decent chance they don't have -r at all.
*BSDs have (=> OS X probably too).
Solaris, HP-UX and OpenServer have not.
AIX is weird:
> -r Searches directories recursively. By default, links to directories are followed.
> -R Searches directories recursively. By default, links to directories are not followed.
Isn't the AIX behavior the one POSIX specifies?
Looking at MattJ100's link (http://pubs.opengroup.org/onlinepubs/009695399/utilities/gre...), it seems like POSIX grep actually does not have any recursion.
Hence, only lubutu's comment ("-R is the recursion flag for ls, cp, rm, etc") is true, while _delirium ("-R is the POSIX-standard flag for recursive grep") is wrong, which means AIX is free to do whatever it wants with both the -r and the -R flags.
That would be kind of perverse given how cp behaves for -r and -R