100,044 reputation
12117248
bio website
location European Union
age
visits member for 2 years, 5 months
seen 1 hour ago

10h
revised Capture in shell variables the arguments after a command (between brackets)
added 225 characters in body
10h
comment Capture in shell variables the arguments after a command (between brackets)
Yes, I misread your question, so deleted my answer which was completely beside the point.
10h
answered Capture in shell variables the arguments after a command (between brackets)
12h
revised process substitution for opening a list of files with an application
It's IFS= to avoid problems with trailing blanks. -print0 is only for newline character. -d $'\0' is misleading in anything but zsh since other shells don't support it (and expand to the empty string or worse). -name '*' doesn't do anything (matches all files).
12h
comment How create a temporary file in shell script?
mktemp originated in HP/UX with a different syntax. Todd C. Miller created a different one for OpenBSD in the mid-90s (copied by FreeBSD and NetBSD) and later made it also available as a standalone utility (www.mktemp.org). That's the one that was typically used on Linux until a (mostly compatible) mktemp utility was added to the GNU coreutils in 2007. Just to say one cannot really say mktemp is a GNU utility.
13h
comment How create a temporary file in shell script?
@WinnieNicklaus, yes, but that doesn't use temporary files so is irrelevant here. Process substitution was introduced by ksh, copied by bash and zsh, and zsh extended it with a 3rd form: =(...).
18h
comment What are the root permissions for a file?
root doesn't have execution permission unless at least one of the execution bits is set.
18h
comment Remove all files recursively without deleting directories
-exec rm {} + is not parallel, it just calls rm with several file names. It runs fewer rm invocations so is more resource-friendly. If it slightly less safe in that it enlarges the race window within which a directory component of the files to remove may be changed to a symlink. But only -delete or -execdir rm {} \; would fully address that.
18h
comment Remove all files recursively without deleting directories
@Costas, I strongly doubt that legend given that even the 2BSD (1978, where csh was first released) csh man page clearly documents {} is passed undisturbed.
18h
comment Remove all files recursively without deleting directories
@Costas, -type f only includes regular files (not symlinks, sockets, fifos, devices, doors...).
18h
comment Remove all files recursively without deleting directories
@ScottWilton, -delete is GNU (and some BSDs) only, -exec rm is standard (though less safe)
18h
comment Remove all files recursively without deleting directories
@Costas, no, there's no shell that requires escaping + (at least not in the Bourne, csh or rc families). There's a legend that says that some old versions of csh required escaping {} but I've never come across those.
18h
comment Remove all files recursively without deleting directories
What about symlinks to directories?
18h
revised Remove all files recursively without deleting directories
`-type f` is for regular files only.
18h
comment Remove all files recursively without deleting directories
Do you want to delete files (hidden or not) in hidden directories?
19h
revised Find the line number which contains the pattern with custom delimiter
added 52 characters in body
19h
comment Find the line number which contains the pattern with custom delimiter
sed -n '\|file /etc|='
20h
revised read first element in array
POSIXified. (woulnd't work in OS/X otherwise)
21h
revised Change of voice via ffmpeg or other application
added 33 characters in body
21h
revised List the files of another format while finding a certain name pattern
clarify