Reputation
123,005
Next tag badge:
98/100 score
38/20 answers
Badges
20 153 311
Newest
 Nice Answer
Impact
~5.1m people reached

Aug
27
comment delete folders older than 1 day
-mmin appears to be supported by AIX 7.1's find. Here, one can use the POSIX -mtime +0 though.
Aug
27
revised delete folders older than 1 day
added 732 characters in body
Aug
27
answered delete folders older than 1 day
Aug
27
comment Retreat from deleted directory
My main concern with that logical handling of .. (as already expressed at that linked answer) is that it's only applied to the shell's cd and pwd, not to other commands, which is possible cause of confusion. IMO, it's a ksh/POSIX misfeature. tcsh has a set symlinks = expand option to expand those .. in any unquoted argument to any command, but I don't like that idea either. Can cause bad surprises as in ssh host rm ../foo.
Aug
27
comment delete folders older than 1 day
What do you consider to be the age of a directory? Note that the modification time of a directory file only reflect the last time an entry was added, removed or renamed in it. It is not updated when any of the files (of type regular or directory or other) linked in it are modified. In particular, any change made to subdirectories or their content doesn't affect the modification time of a directory.
Aug
27
comment Check if multiple files exist in directory
If they are required, then it seems to me your script should fail if any of them is missing, not if all of them are missing.
Aug
27
comment Retreat from deleted directory
See the link I gave. Some shells check that $PWD still correspond to the current directory before doing a cd (and recompute $PWD). Some don't (dash and ksh93u+ on Linux at least will do a chdir(dirname($PWD)) even if the current directory has been removed or moved elsewhere). Also note that on Linux, chdir("..") works in a deleted directory (even ../.. when both directories were deleted as the kernel keeps track of that somehow).
Aug
27
revised How to use tar to compress a group of files in a .txt file?
added 423 characters in body
Aug
27
answered How to use tar to compress a group of files in a .txt file?
Aug
26
awarded  Nice Answer
Aug
26
revised Symbolic link recursion - what makes it “reset”?
deleted 7 characters in body
Aug
26
comment Retreat from deleted directory
OK, that's part misunderstanding/talking about different things and Linux vs Solaris. After more checking, there's also some differences for bash between sh mode and non-sh mode. The behaviour of ksh88 and ksh93 also differs. Most of what you said and what I've said is true in some contexts and inaccurate in others. A long article would be needed here to summarize the different behaviours. See also Symbolic link recursion - what makes it “reset”? for some more info. I'll delete my comments for now.
Aug
26
comment Why do Linux/POSIX have lchown but no lchmod?
@schilly, OS/X does honour permissions on symlinks. There, if you don't have read permissions, you can't resolve their targets.
Aug
26
revised Why do Linux/POSIX have lchown but no lchmod?
added 35 characters in body
Aug
26
reviewed Approve Why do Linux/POSIX have lchown but no lchmod?
Aug
26
comment Why pipe to cat only to redirect?
On the other hand, with shells like the Bourne shell, AT&T ksh or yash, prog | cat could return before prog has returned (In those shells, it will return as soon as cat returns, which will happen as soon as prog (and its children if any) has closed all its fds to the pipe)). Try for instance with prog being sh -c 'echo A; exec >&-; sleep 2; echo >&2 B'.
Aug
26
comment Why pipe to cat only to redirect?
As far as this unix.stackexchange.com Q&A site is concerned, that's Unix-like systems yes (though other POSIX systems are also covered). And as far as this question is concerned, you'd expect a system where cat (a typical Unix command) is available.
Aug
26
comment Why pipe to cat only to redirect?
< file wc > file2 is Bourne and POSIX and also works in (t)csh, rc and es. The only shell I could find that doesn't support it is fish (which is the most modern of them all). It even worked in the pre-Bourne sh of Unix V1 in 1970!
Aug
26
revised Symbolic link recursion - what makes it “reset”?
Looks like it was a ksh invention. tcsh 5.7 (87) didn't have ignore_symlinks yet.
Aug
26
revised Symbolic link recursion - what makes it “reset”?
not sure where I got that was a csh invention.