99,719 reputation
12117248
bio website
location European Union
age
visits member for 2 years, 5 months
seen 6 mins ago

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.
Dec
12
comment How to know where a program is stuck in linux?
See also /proc/pid/wchan and the WCHAN column in ps -l output or ps -o wchan for the top of that stack. (the ps part works on many Unices, but is not always (often) useful in itself).
Dec
12
comment How to know where a program is stuck in linux?
Also note access to that file is limited to superuser or the process itself (at least on the systems I've tried).
Dec
12
comment How to know where a program is stuck in linux?
pstack's README does say it's only for 32bit, ELF, x86, GNU.
Dec
12
comment only show the source file and target linked file using `ls`
See the man page or there for FreeBSD. If you want to test things on FreeBSD, you can use live CDs like GhostBSD/mfsbsd in a VM.
Dec
12
comment Is it better to use $(pwd) or $PWD?
only in some shells (not bash, dash, zsh or ksh93 for instance) will pwd potentially give you less stale information than $PWD in some corner cases. $(pwd) on the other hand doesn't work if the current directory ends in newline characters, means forking a process (except in ksh93) and use extra resources. My view is use $PWD of $(pwd -P), it's not worth using $(pwd).
Dec
12
comment only show the source file and target linked file using `ls`
Do you know of any implementation besides modern versions of GNU ls that supports LS_COLORS that way and a --color=always and options after arguments? If on a GNU system, why would you use something that convoluted when you can use find or stat? That also probably won't work if you do some ln -s /// some-file.