Reputation
Next tag badge:
399/400 score
103/80 answers
Badges
17 139 279
Newest
 Enlightened
Impact
~4.0m people reached

Dec
15
comment What is the fastest way to create a list of directories specified in a file?
@John, xargs runs as many instances of the command as needed so as to avoid the limit on the maximum number of arguments. So it will probably invoke many mkdir commands each one of them passed a few thousand of directories to create.
Dec
15
revised What is the fastest way to create a list of directories specified in a file?
added 8 characters in body
Dec
15
comment What is the fastest way to create a list of directories specified in a file?
@Sree, expanding $(cat...) means reading the output of cat in memory, split+glob it and iterate over the resulting huge list.
Dec
15
answered What is the fastest way to create a list of directories specified in a file?
Dec
15
comment What is the fastest way to create a list of directories specified in a file?
To read a line, it's IFS= read -r line, read line does extra processing. Leaving $line unquoted means invoking the split+glob operator. mkdir can take several arguments.
Dec
15
comment What is the fastest way to create a list of directories specified in a file?
That's running one mkdir per directory and is flawed because of that wrong usage of read and the split+glob operator.
Dec
15
comment What is the fastest way to create a list of directories specified in a file?
That's running one mkdir per directory and is flawed because of that wrong usage of the split+glob operator. That also means storing that whole huge list in memory.
Dec
14
revised Replace %20 with a space in filenames?
more quotes missing, usage of echo, missing --
Dec
14
revised Replace %20 with a space in filenames?
missing --
Dec
14
comment Security implications of forgetting to quote a variable in bash/POSIX shells
@mirabilos. Yes, see how he's already using set -f in other functions (note there's a local scope for options inside function f { declared functions in ksh93)
Dec
14
awarded  Nice Answer
Dec
13
comment How can I store each seperate entire line in a text file into an array?
You also need set -f.
Dec
13
comment Extracting the second word from a string variable
awk '{print $2}' prints the second field of each line of the previously displayed x.
Dec
13
comment Extracting the second word from a string variable
echo $x is not display the value of x. printf '%s\n' "$x" would be.
Dec
12
awarded  Guru
Dec
12
comment How was the Shellshock Bash vulnerability found?
Don't assume I read each and every question on this site. See thread.gmane.org/gmane.comp.security.oss.general/14177/… for a short answer.
Dec
12
revised Need to move the last line of the file to second line of the same file
using -0 or join doesn't make sense here. typo.
Dec
12
awarded  Nice Answer
Dec
12
comment only show the source file and target linked file using `ls`
You need -l to retrieve the symlink target, so ls-F won't do.
Dec
12
comment only show the source file and target linked file using `ls`
recent versions of tcsh have a ls-F builtin that supports LS_COLORS the same way as some versions of GNU ls, but it resorts to invoking ls -F if you pass any option to it, so that won't work here unless ls is GNU ls on your system.