105,124 reputation
13123256
bio website
location European Union
age
visits member for 2 years, 7 months
seen 7 hours ago

Feb
11
comment Not managing to make AND operator work in bash script
If you're using [[, you should change the she-bang to be #!/bin/ksh or #!/bin/bash. There's no [[ in the standard sh language. In sh, you'd write [ "$1" = on ] && [ "$2" -eq 1 ].
Feb
11
reviewed Leave Open Loading and execution of programs in memory
Feb
11
comment Linux LXC vs FreeBSD jail
Great answer. (you're browser/keyboard seems to have a problem in that it inserts acute accents (´) in place of apostrophes ('))
Feb
11
comment Check in ksh if a directory is empty
find path_to_dir/. ! -name .. -path is a recent POSIX addition, doesn't seem to have made its way to AIX yet
Feb
11
comment How can I exclude a string using a regular expression?
Your long regexp fails on ttimetosa. See groups.google.com/forum/#!msg/comp.unix.shell/dMA7D9wLe6E/…
Feb
10
comment Check in ksh if a directory is empty
@Gilles, it also prints empty if the first file expanded from that * is not regular (directory, fifo, socket...)
Feb
10
comment Check in ksh if a directory is empty
AIX find doesn't have -mindepth.
Feb
10
comment On Ctrl+C, kill the current command but continue executing the script
Or trap : INT
Feb
10
revised On Ctrl+C, kill the current command but continue executing the script
POSIXified.
Feb
10
revised How to do a continous 'wc -l' with gnu texttools?
added 91 characters in body
Feb
10
comment how to keep the spaces when inserting line to parameter
I propose (or at least intended to propose) to close as duplicate of that canonical question, there are tons of closer fits as that's the most FAQ about shells, it all boils down to that wrong usage of the split+glob operator (forgetting the quotes).
Feb
10
comment how to keep the spaces when inserting line to parameter
Don't forget to quote your variables!. echo "$CSV_LINE" or better printf '%s\n' "$CSV_LINE"
Feb
10
comment How can I exclude a string using a regular expression?
timetosa as a regexp would match anything that contains timetosa unless your regexps are implicitly anchored (as with grep -x) in which case you'll want .*timetosa.* (beware of the effect of locales though as . could fail to match bytes that are not part of valid characters).
Feb
10
comment Find and rm command not obeying exclude list occassionally
@Costas, or use find "$basedir/." or cd -P -- "$basedir" && find ., not all find implementations have -mindepth.
Feb
10
comment Using 'grep' to find lines that contain all of three specified characters in any order
If comparing with perl, you'd need to pass -Mopen=locale to perl, or use LC_ALL=C for the other solutions.
Feb
9
comment Equivalent of “which” in sh
@mikeserv, thanks. Looks like I'm not up to date. That was from memory from an older spec it would seem.
Feb
9
comment Equivalent of “which” in sh
No, and you're quoting an "informative", not spec section.
Feb
9
comment How do I add a \n to the end of the record on file using AWK
echo >> manifest.txt (not from (t)csh where you need echo "" >> manifest.txt)
Feb
9
comment Equivalent of “which” in sh
Both type and command -v are optional in POSIX. They are not guaranteed to be present in POSIX conformant shells, they are in Unix conformant shells. They're not required to be builtin but in practice, they would have to be. Unix requires there be a non-builtin one (of limited usefulness). Systems that provide with them usually implement them as shell scripts that invoke the corresponding builtin.
Feb
9
revised Split an input for different command and combine the result
make code self-explanatory