Hi
Probably because the elements with id btnEdit and btnSelect are a elements which by default are inline elements. When you toggle their visibility you change their display to block. Try to not do that :
selectbtn.style.display = "inline"; // Show button
editbtn.style.display = "inline"; //...
Hi
That is CMD problem, not Awk problem. You need to fix your quoting :
[ ] ╭─pair─╮ ╭───────pair────────╮
▼ ▼ ▼ ▼
awk -F, [highlight palegoldenrod]"{nvar="[/highlight]test[highlight palegoldenrod]"; print $1 nvar $2}"[/highlight] tt.txt
In...
Hi
Pretty sure it never worked exactly like that, as there is syntax error due to too many slashes ( / ).
Do not let yourself confused by the fact that both the s command and the regular expression address are using slashes as delimiters. They are completely separate things :
As they...
Hi
I would use an address to split the regular expression in 2 less complex ones :
address command
( in lines matching this ) ( do this )
╭────────────┴───────────╮ ╭──────────┴────────╮
sed '/^prod:admin:batch:daily:/ s/:server1$/:server2/'...
Hi
$1 needs no escaping as it has no special meaning. ( The placeholder for the 1st captured group is \1. )
& can be escaped by prefixing it with a backslash : \&.
So should be :
sed -i 's/# UserParameter=/UserParameter=systemd.unit.is-active,systemctl is-active --quiet $1 \&\& echo 1 ||...
Hi
There you concatenated the 3 field. print then out as separate fields. I mean, put comma ( , ) between them, so they get output with output field separator between them.
If you not want to change the separators, set the OFS ( output field separator ) to the same as FS ( field separator )...
Hi
Thinking again, would be simpler and faster with a for loop and substr() :
function comma(n , i)
{
for (i = index(n, ".") ? index(n, ".") - 3 : length(n) - 2; i > 1; i -= 2) {
n = substr(n, 0, i - 1) "," substr(n, i)
}
return n
}
Feherke.
feherke.github.io
Hi
There is nothing special. Let us rewrite it abit :
function comma(n , new_n)
{
new_n = gensub(/([[:digit:]])([[:digit:]]{3}$|[[:digit:]]{2},)/, "\\1,\\2", 1, n)
while (n != new_n) {
n = new_n
new_n = gensub(/([[:digit:]])([[:digit:]]{3}$|[[:digit:]]{2},)/...
Hi
For integers this should do it for any size :
function comma(n , nn)
{
while (n != nn = gensub(/([[:digit:]])([[:digit:]]{3}$|[[:digit:]]{2},)/, "\\1,\\2", 1, n)) {
n = nn
}
return n
}
For fractional part I did not got the rule.
Feherke.
feherke.github.io
Hi
Maybe my memories are failing, as I can not reproduce it right now, but I have a feeling that also met it with print when writing to file. But I would say on file/pipe input/output operations.
Feherke.
feherke.github.io
Hi
Dumb thing as according to operator precedence should be fine, but in reality you have to add parentheses :
awk 'BEGIN{
month=202303
print getline < ("file"month) <0 ? "Not Available" : "Available"
}'
Feherke.
feherke.github.io
Hi
Those are 2 different metacharacters :
. means any character
* means the previous entity 0 or more times
You can find them documented in the perlre manual's Metacharacters section.
Some examples :
'abc' =~ m/<.*>/ # not matches, presence of < and > is mandatory
'a><bc' =~ m/<.*>/ # not...
Hi
First of all, never user input data directly interpolated in SQL statement. That way you make your code vulnerable to SQL injection attacks. The Bobby Tables site explains the problem and the solution in simple terms.
Apparently there are user 2 completely different data access solutions...
Hi
Hard to understand what are you doing there.
In the 1st code how does the $message variable get its value ?
In the 2nd code how do the $date, $c_user, $to, etc variables get their values ?
Probably would be better to show us the code that is not working so we can tell what the problem is...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.