Reputation
Next tag badge:
97/100 score
36/20 answers
Badges
18 145 291
Newest
 Nice Answer
Impact
~4.4m people reached

Jun
3
revised Security implications of running perl -ne '…' *
added 102 characters in body
Jun
3
revised Security implications of running perl -ne '…' *
added 506 characters in body
Jun
2
awarded  Guru
Jun
2
comment find files in current directory
@lcd047, that's the wrong format. For that file, you need file.txt to contain 'a b' or a\ b or a" "b... That's why I said provided it's in the right format. Note that blanks and newline are not the only characters to quote. The quoting characters themselves also need quoted.
Jun
2
comment find files in current directory
@lcd047, the OP didn't fully specify the exact format of file.txt. xargs rm -f -- < file.txt can handle file names with spaces or even newline (while xargs -d '\n' or your tr|-0 can't) provided file.txt is in the right format.
Jun
2
comment find files in current directory
@lcd047, the OP didn't fully specify the exact format of file.txt. xargs rm -f -- < file.txt can handle file names with spaces or even newline (while xargs -d '\n' or your tr|-0 can't) provided file.txt is in the right format.
Jun
2
comment list files in ascending order
ls -1trd /dir1/subdir1/*. Try man ls
Jun
2
comment find files in current directory
xargs rm -f -- < file.txt ?
Jun
2
revised $VAR vs ${VAR} and to quote or not to quote
note that it's not about blank, but about IFS characters.
Jun
1
comment How to find files with 100% NUL characters in their contents?
Fails on a file created with printf '\0\n\0\0\n\n' > file or printf '\n' > file for that matters.
Jun
1
revised Get specific number in line
added 226 characters in body
Jun
1
answered Get specific number in line
Jun
1
comment Testing if a file descriptor is valid
exec being a special builtin will exit the shell if it fails (for bash, only when in POSIX compliance mode). command exec prevents that. true is not a special builtin. Note that exec and command exec do affect the current environment (that's why I said if you want to redirect stdout to it).
Jun
1
revised Testing if a file descriptor is valid
added 489 characters in body
Jun
1
comment Testing if a file descriptor is valid
{ true >&3; } 2> /dev/null will not affect the current environment either and won't fork (except in the Bourne shell). I mean that (exec 1>&3) 2>&- will return true for a fd open in read-only mode.
Jun
1
answered Testing if a file descriptor is valid
Jun
1
comment Testing if a file descriptor is valid
That creates a subshell though which is most shells means forking a process. That doesn't guarantee the fd is writeable. You can use { true >&3; } 2> /dev/null to avoid the fork. Or { command exec >&3; } 2> /dev/null if you want to redirect stdout to it.
Jun
1
comment Overridable functions in Zsh
functions[git_prompt_info]=$functions[branch_name_only_git_prompt_info]
Jun
1
awarded  Enlightened
Jun
1
revised Why is nullglob not default?
added 55 characters in body