Reputation
710
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
5 24
Impact
~32k people reached

Jul
18
comment PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/php_mysql.so'
What about extension=mysql.so in php.ini? Just checked a closely related RPM package (CentOS 7) and in that case, the module was actually found under /usr/lib64/php/modules/mysql.so! If that works, the packager should get a decent slap, because of breaking common file naming due to doing things his own way!
Jul
18
comment PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/php_mysql.so'
Looks like Fedora, but I'm not that sure...might as well be RHEL
Jul
16
comment How to pass shell variable to an awk search pattern?
@mikeserv Oh you're right, of course I was actually referring to the combined operator ~= where the tilde is followed by an = operator. Good catch of yours (as usual). :)
Jul
16
comment How to pass shell variable to an awk search pattern?
@glennjackman And if I may add this, this is not even an awk specialty, as some people may think...unless you insist on using a very ancient bash, the ~ operator will also work with the test shell command (aka [[ ]]). If more people knew about this, a lot of bash scripts would look way less messy, since the alternate method (i. e. pattern matching) will often make the expression harder to follow than a regular expression would...
Jun
27
comment Decoding URL encoding (percent encoding)
Great solution. And even shorter and smarter: ... | sed 's/+/ /g;s/%\(..\)/\\\\x\1/g'. The -e option can be omitted here in fact...
Jun
27
comment Decoding URL encoding (percent encoding)
awk: As this makes use of a library function, chr(), there is a high probability it will solely work on GNU awk (gawk). However, in this case there will be hardly any equivalent for POSIX awk, because the -n option (allowing non-decimal arguments) IS a GNU awk specialty.
Jun
25
comment How can I find broken symlinks
Yet another shorthand for those whose find command does not support xtype can be derived from this: find . type l -printf "%Y %p\n" | grep -w '^N'. As andy beat me to it with the same (basic) idea in his script, I was reluctant to write it as separate answer. :)
Jun
24
comment Any CLI to validate URL?
Even wget can do that to a certain extent (wish I could write an answer here, but the ever-present SE "cerberuses" have chosen to close this question). * Sigh * So here goes ... You may (mis)use wget -nv --spider <someURL> and evaluate its return code (echo $?). This is only for checking whether the link is valid (respectively the server still up) or not, though.
Jun
24
revised Decoding URL encoding (percent encoding)
cat UUOC nonsense removed. (Will people ever get rid of this for good?)
Jun
24
suggested approved edit on Decoding URL encoding (percent encoding)
Jun
24
comment “wget --restrict-file-names=windows” seems to fail converting links for NTFS
@slm Small typo sighted: must be --restric**t** ... Unfortunately due to the (IMO most idiotic) rule on SE that you may only fix typos if you also edit something else (>=6 char limit), I can't fix it myself, as there is really nothing else that needs to be altered.
Jun
23
comment Shell pattern matching and arithmetic operators (+ - * / %)
It's in fact the other way round. I DO NOT expect data with * or - as first character, but the shorter expression will allow this (and I can't permit that ;)) IOW, the shorter one is too liberal and data which should be filtered out will be shown.
Jun
23
comment Shell pattern matching and arithmetic operators (+ - * / %)
Thanks, also for the info about \s. Well, I wanted to support both tabulators (et al.) and "plain" spaces, hence I used \s on purpose. However, I wasn't aware that this is not part of ERE. Most peculiar...
Jun
23
comment Shell pattern matching and arithmetic operators (+ - * / %)
Note that \s* stands for various whitespace like e. g. tabulators as well. Your shorter solution blindly assumes that whitespace = space, which is a little naughty ;) Plus, whatever you write into [ ] is arbitrary in order, whilst my expression dictates a definite order - for a reason! Your expression would even allow a * or - as first characters, which is plainly wrong, as they are arithmetic operators and must be preceded by a number. Shorter is not always better, as it may unwantedly alter the logic.
Jun
23
comment Shell pattern matching and arithmetic operators (+ - * / %)
"but you can consume the expressions and see if the result is empty" * GASP * Eh? That sed approach is a dirty hack. As Costas shows in the other answer, it can be done with pattern matching - there was just a tiny nudge into the right direction that I was missing. :)
Jun
23
comment Shell pattern matching and arithmetic operators (+ - * / %)
SO simple? Just putting the ^ at the beginning did the trick. Thank you very much! (also for not inverting the logic for no reason ;)) Again: single numbers must work as well as numbers with addends. So it is not that simple as replacing * by +.
Jun
23
comment Shell pattern matching and arithmetic operators (+ - * / %)
@ikrabbe It definitely doesn't. :) So I now get it, you were the initiator of inverting the logic, and user179... just jumped on the bandwagon. LOL.
Jun
23
comment Shell pattern matching and arithmetic operators (+ - * / %)
@ user1794469 No. Doesn't help me at all. By replacing && by ||, you've just inverted the logic. Coolish. But that's totally pointless, as I need the result of the expression itself, not the result if the expression is false.
Jun
23
comment Shell pattern matching and arithmetic operators (+ - * / %)
Thanks, but it's meant to be that way. :) It should match on "1234" as well as "2345*6789*4321", or in prose, on single numbers as well as on "formulae" (i. e. additions in this case). However, the problem is that it matches also on additions + and divisions /, even though I'm only allowing subtractions and multiplications in this sample one-liner. Your answer will also exclude standalone numbers, as now you do no longer allow that the addend be omitted.
Jun
23
asked Shell pattern matching and arithmetic operators (+ - * / %)