Search Results

Search: Posts Made By: kenshinhimura
3,753
Posted By vgersh99
how about: echo '<Connector port="8009"...
how about:

echo '<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />' | sed '/<Connector port="8009".*\/>/ s#.*#<!-- & -->#'
1,314
Posted By Don Cragun
You have a few problems. The date utility always...
You have a few problems. The date utility always terminates its output with a <newline>. The awk system() function sends its output to awk's standard output and returns the exit status of the...
1,314
Posted By Don Cragun
Since you want to print an average every time you...
Since you want to print an average every time you print a total for a set, you don't need two functions to print the total and the average -- just add another printf statement in the print_total...
1,314
Posted By Don Cragun
Of course my suggested awk script can be turned...
Of course my suggested awk script can be turned into a single line of code. But, if you can't do that on your own, there is absolutely no possible way that the 1-liner version of that code will be...
1,314
Posted By Don Cragun
You might try something like: awk ' function...
You might try something like:
awk '
function print_total() {
printf("\nTotal Sum of %s: %d\n", last, total)
}
last != substr($1, 1, 4) {
if(NR > 1) {
print_total()...
1,605
Posted By RudiC
sed ' enclose First parameter /...
sed
' enclose First parameter / Script
/.../ for lines only matching ... pattern
{ start compound statement
s/.../.../ substitute pattern(s)
; separate...
1,605
Posted By wisecracker
I have been looking at the file structure: 1)...
I have been looking at the file structure:
1) All lines start with the " ", single space, character as an absolute minimum, are these indents and need to be preserved?
2) If so then line 1 is...
1,605
Posted By rdrtx1
sed '/<!--.*<connections_per_host>1</{s/<!--//;...
sed '/<!--.*<connections_per_host>1</{s/<!--//; s/-->//; s/>.*</>5</};' INPUT
1,605
Posted By rdrtx1
grep connections_per a|sed -e 's/<!--//g;...
grep connections_per a|sed -e 's/<!--//g; s/-->//g;'
This does not change the value in the tag as shown in the output.
1,605
Posted By bakunin
In addition to what rdrtx1 already explained: ...
In addition to what rdrtx1 already explained:

If you want to change something only on certain lines and not on others you should do that in sed, not outside, with grep::

sed '/^special_line/...
3,312
Posted By Aia
Not truly hard. The hard part is for you to...
Not truly hard. The hard part is for you to recognize the way that you discern what files need to be copied when you do it manually and communicate it in a way that can be translated into an...
3,312
Posted By RudiC
Your statement / request is not quite clear. You...
Your statement / request is not quite clear. You use locate yourself in post#1. Do you want all files located (including the ones whose file names are supersets of the search term) to be copied to...
1,170
Posted By MadeInGermany
The following uses a stage variable met that...
The following uses a stage variable met that controls where to insert the new text. If there was no match encountered (met==0) or the new text was not yet inserted (met==1), it inserts the new text...
1,170
Posted By RudiC
Howsoever, try awk ' /^server/ {$1 =...
Howsoever, try
awk '
/^server/ {$1 = "#" $1
}
/#broadcast / {print "server ntpserver.com"
print "server 127.127.1.0 # local clock"
...
1,170
Posted By MadeInGermany
Literal strings must be in "quotes". Also you...
Literal strings must be in "quotes". Also you certainly want to explicitly print.
awk '{if ($1 == "server") {$1 = "#server"} print}' /etc/ntp.confAnother solutions
awk '{if ($1 == "server") {print...
958
Posted By RudiC
Try (not thouroughly tested, so double check!),...
Try (not thouroughly tested, so double check!), given SRCPATH and DSTPATH hold the respective directories, and diff offers the options needed:
cd $DSTPATH
md5sum * > /tmp/dstsum
cd $SRCPATH...
1,407
Posted By bakunin
Of course, but we would really appreciate it if...
Of course, but we would really appreciate it if you could obey the forum rules and post code (any code, data and output) in CODE-tags or - if they appear in running text, like commands - in...
2,114
Posted By hicksd8
Another suggestion is to insert a line just...
Another suggestion is to insert a line just before your cron job finishes to write out a timestamp file. Then you set up a simple second cron job to run, say, five minutes after the first job to...
2,114
Posted By jim mcnamara
This question is really rather vague. But since...
This question is really rather vague. But since I do not want to seesaw back and forth trying to extract details, consider:

1.cronjob opens for write a log e.g., /path/to/files/logfile
2. write...
1,093
Posted By RavinderSingh13
Hello kenshinhimura, Could you please try...
Hello kenshinhimura,

Could you please try following and let me know if this helps you.

sort -k1.1 file1
Output will be as follows.

asa001 a
asa003 hekk
asa012 try a d g
asa111 this is...
1,093
Posted By Don Cragun
The command: sort -k1.1 file sorts file with...
The command:
sort -k1.1 file
sorts file with a sort key that starts with the 1st character on each line and continues to the end of the line. What was requested was:
sort -k1.1,1.6 file
which...
937
Posted By RudiC
How about awk '!/com\./' file whois nba.com|...
How about awk '!/com\./' file
whois nba.com| sed -n '/Registry Registrant ID:/,/Registrant
whois ymas.com| sed -n '/Registry Registrant ID:/,/Registrant


---------- Post updated at 17:41...
937
Posted By MadeInGermany
If the separator is . then the field (#2) ends...
If the separator is . then the field (#2) ends at the next . or at the end of the line.
You can do an ERE-search:
awk -F. '$2 ~ /com|/ {print $0}' aa.shor limit the search to the beginning of the...
973
Posted By Don Cragun
awk '{printf("%s%3d\n", $2, $3)}' awk:...
awk '{printf("%s%3d\n", $2, $3)}'

awk: utility to run.
'{printf("%s%3d\n", $2, $3)}': script to be interpreted by awk.
'{ commands }': run the specified commands for each line read from...
973
Posted By Franklin52
With printf you can use the width trick,...
With printf you can use the width trick, something like:
date | awk '{ printf("%s %*s\n", $2, 2, $3) }'
Showing results 1 to 25 of 43

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