Search Results

Search: Posts Made By: hergp
2,516
Posted By hergp
What is the error message? It works here on...
What is the error message? It works here on CentOS 6.5:

$ cat input
john,5
marco,7
john,4
paul,3
marco,8
$ awk -F, '{ A[$1]+=$2 } END { OFS=","; for (x in A) print x,A[x]; }' input
paul,3...
6,002
Posted By hergp
This minor version difference should not matter. ...
This minor version difference should not matter.

Probably a login script like .bashrc or .profile produces some output which confuses rsync. If so, eliminate this output at least for non...
1,599
Posted By hergp
sudo switches users, not groups. But you can...
sudo switches users, not groups. But you can assign the apache group to those users as secondary group

usermod -a -G apache fred
After this, fred is a member of both groups simultaneously. Both...
1,599
Posted By hergp
For example fred ALL=(apache) ALL allows...
For example

fred ALL=(apache) ALL
allows fred to switch to the apache user. He has to enter his own password every time he switches. If he shall be allowed to switch without entering his...
Forum: Red Hat 06-17-2017
13,071
Posted By hergp
Firewalld implements a zone concept. To allow...
Firewalld implements a zone concept. To allow access to services based on the source address, just create a new zone, add source addresses and services to the zone and you are done.

Here is an...
1,224
Posted By hergp
Try awk '{ if ($3 == "TS_") $5 = "$-1.00" ;...
Try

awk '{ if ($3 == "TS_") $5 = "$-1.00" ; print }' input >output
Forum: Programming 10-17-2016
1,738
Posted By hergp
The shebang line does only work with languages...
The shebang line does only work with languages that interpret the hash-sign as a comment. Javascript does not, so it thinks, that #!/usr/bin/js is a valid statement. By the way, if you feed your...
7,295
Posted By hergp
You can try this awk script. It looks for fields...
You can try this awk script. It looks for fields looking like dates, splits them into month, day and year and recombines them using a proper format.


BEGIN {
FS="|"
OFS="|"
}
{
...
18,524
Posted By hergp
%5dn prints the line number with a standard...
%5dn prints the line number with a standard printf like format of %5d (numeric, 5 characters wide with leading blanks).

< or > are literal strings.

%L is substituted by the line content.
...
18,524
Posted By hergp
Or maybe this? file1: one two three ...
Or maybe this?

file1:
one
two
three
file2:
one
two
four
and
$ diff --old-line-format="%5dn< %L" --new-line-format="%5dn> %L" --unchanged-line-format="" file1 file2
3< three
3>...
2,223
Posted By hergp
Looks like the output of the select statement is...
Looks like the output of the select statement is not just 0, but something like 0.

If the status code in the database does not contain blanks, you just could remove the quotes from the case...
2,223
Posted By hergp
I am not sure, if I understand you correctly. Do...
I am not sure, if I understand you correctly. Do you mean the SQL SELECT statement or the case-construct afterwards? Can you give an example?
2,223
Posted By hergp
You might want to run db2 -x SELECT ... to get...
You might want to run db2 -x SELECT ... to get rid of the heading and 1 record(s) selected.
2,857
Posted By hergp
You could use awk to produce the SQL statements...
You could use awk to produce the SQL statements to query the database and pipe the output to the DB2 CLP, for example

awk -f script.awk inputfile | db2 +p -x

You will have to print the CONNECT...
5,138
Posted By hergp
What the example says is this: If you want...
What the example says is this:

If you want to send to a system in the 10.0.0.0 network, you don't have to use a gateway (router). Just send the packet out of the eth1 interface and the destination...
Forum: Linux 11-04-2015
2,452
Posted By hergp
The request is processed by a virtual host with a...
The request is processed by a virtual host with a matching ServerName or ServerAlias. If no one matches the url, the first virtual host defined will process the request.

You can dump some...
1,196
Posted By hergp
DSA keys should work pretty much the same way RSA...
DSA keys should work pretty much the same way RSA keys do.

If the public key is not recognized by the server, check that the permissions on ~/.ssh and ~/.ssh/authorized_keys on the server are set...
Forum: Red Hat 09-10-2015
1,815
Posted By hergp
What does chkconfig --list X say? The...
What does

chkconfig --list X
say? The output should look like in this example:

# chkconfig --list X
X 0:off 1:off 2:on 3:on 4:on 5:on 6:off
But if it reads

...
Forum: Red Hat 05-11-2015
3,171
Posted By hergp
The ignoredisk option should do just what you...
The ignoredisk option should do just what you want. To ignore all FC-LUNs, for example, put

ignoredisk --drives=/dev/disk/by-path/pci-*-fc-*

into your kickstart file. This is documented here:...
1,616
Posted By hergp
Unfortunatelly this sequence is not a perfect...
Unfortunatelly this sequence is not a perfect if-then-else replacement. It works as expected in situations like:

$ true && echo true || echo false
true
$ false && echo true || echo false...
Forum: Solaris 04-20-2015
9,085
Posted By hergp
Have a look at...
Have a look at /var/svc/log/network-ntp:default.log, it might have useful information about why the service is failing.
7,555
Posted By hergp
The only situation I can think of where this...
The only situation I can think of where this might be useful is a shared webhosting environment with ssh access. In this case the admins might want you not to execute any stuff not provided by the...
1,486
Posted By hergp
awk can read multiple files in one run, just use...
awk can read multiple files in one run, just use all filenames or a wildcard expression on the command line

awk -f script.awk *.xls

You do not need cat for this. Or if you need the intermediate...
1,486
Posted By hergp
Try this { val = substr ($1, 1, 8); ...
Try this

{
val = substr ($1, 1, 8);
cod = substr ($1, 9, 2);

if (index (array[val], cod) == 0) array[val] = array[val] " " cod;
}

END {
for (val in array)
if...
1,486
Posted By hergp
This bash-script should do the trick: ...
This bash-script should do the trick:

#!/bin/bash

declare -A array

while read line
do
case "${array[${line:0:8}]}" in
*${line:8:2}*)
;;
*)
...
Showing results 1 to 25 of 173

 
All times are GMT -4. The time now is 03:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy