Search Results

Search: Posts Made By: sdosanjh
40,819
Posted By Peasant
Please open new topics for new questions. Do...
Please open new topics for new questions.
Do not revive months old threads with new issues.

As for your question, issue a recursive chown after untar-ing on the destination on the newly created...
12,942
Posted By Peasant
Try adding the -P option to both tar commands and...
Try adding the -P option to both tar commands and omit the change directory.
Since you are extracting full paths, you do not need to cd to anywhere.


tar -Pcvf - $filename |ssh -p222...
8,389
Posted By Corona688
The new way: <span style='color:...
The new way: <span style='color: blue;'>Hello</span>
The old way: <font color="blue">Hello</font>
The new way is preferred, but some old email clients might want the old way.
7,394
Posted By Neo
Have you considered formatting and sending your...
Have you considered formatting and sending your email message as an HTML file?
3,917
Posted By Don Cragun
What operating system are you using? Exactly...
What operating system are you using?

Exactly what command did you run that produced the diagnostics:
awk: syntax error near line 2
awk: illegal statement near line 2
awk: syntax error near line...
1,889
Posted By RudiC
Like so: grep -F ".BY." file | sort -t. -k2,2r...
Like so:
grep -F ".BY." file | sort -t. -k2,2r -k4,4 -k5,5
xxxx.Merge.exchMon.BY.qStart 09:55 read
xxxx.Merge.exchMon.BY.qStop 15:30 read...
1,889
Posted By RudiC
Wouldn't a simple sort help?
Wouldn't a simple sort help?
1,889
Posted By vgersh99
hm.... this was a confusing explanation to begin...
hm.... this was a confusing explanation to begin with.....

awk -v code="${CODE}" -F'[. ]' '$4==code && $5=="qTime"{qt=$0;next}$5=="qStop" && qt{print qt;qt==""}1' myFile
1,889
Posted By vgersh99
something along these lines? CODE=BY awk...
something along these lines?

CODE=BY
awk -v code="${CODE}" -F. '$3==code' myFile
3,917
Posted By RudiC
If you are using a Solaris/SunOS system, use...
If you are using a Solaris/SunOS system, use /usr/xpg4/bin/awk or nawk instead of awk.
3,917
Posted By RudiC
Well, this might work, taking advantage of the...
Well, this might work, taking advantage of the data structure as shown:
awk '
match ($0, /(GAP|DUP)[^)]*\)\)/) {TMP1 = substr ($0, RSTART, RLENGTH-2)
...
3,917
Posted By RudiC
This is difficult if not impossible, as you have...
This is difficult if not impossible, as you have spaces as field separators but also contained in desired output values. Do you see a chance to define fields and separators differently?
1,081
Posted By RudiC
You can cram all the sed commands into one...
You can cram all the sed commands into one script:
sed 's/.../.../g; s/.../.../g; s/.../.../g' file
Are those back references really necessary, e.g. to discriminate possible duplicates? If not, try...
1,324
Posted By RudiC
Wouldn't a better wording be "sed is not taking...
Wouldn't a better wording be "sed is not taking shell variable value when used in above setup"?
sed by its design / implementation is not meant to take shell variables (there's more suitable tools...
1,324
Posted By vgersh99
so many quotes - so little time... sed...
so many quotes - so little time...

sed "s/\(.*def.monitor.${CODE}.qStart.*\)${cur}\(.*read\)/\1${new}\2/g" $FILE
21,678
Posted By rdrtx1
sed 's/_[^_]*$//' abc.1 If substr must be...
sed 's/_[^_]*$//' abc.1

If substr must be used in awk, try:
awk '{print substr($0, 1, (match($0, "_[^_]*$") ? RSTART - 1 : length))}' abc.1

or try another awk solution:
awk -F_ 'NF<2 || NF--'...
1,366
Posted By rdrtx1
try: $file = `ls -1rt...
try:
$file = `ls -1rt /abc/def/ghi/xyz.\$(hostname).2???.??.??.??.??.* | tail -1` ;
chomp($outfile = $file) ;
print "THE OUTFILE IS ......................... $outfile\n";
978
Posted By RavinderSingh13
Hello sdosanjh, Could you please try...
Hello sdosanjh,

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

chomp($fulldate);
print "\nRecord count for $fulldate is $reccount\n";


Thanks,
R. Singh
8,821
Posted By rbatte1
If the text string in column 2 that you wish to...
If the text string in column 2 that you wish to exclude will always be described as a space followed by a single zero and then the end of line, that would give the regular expression 0$ that you...
8,821
Posted By RavinderSingh13
Hello sdosanjh, With awk here is one of the...
Hello sdosanjh,

With awk here is one of the solution.


awk '$2' filename
OR
awk '($2!=0) {print}' filename


Output will be as follows.

OPge1 03
OPge10 121
OPge11 3
OPge14 25

...
4,303
Posted By SriniShoo
Removed the <br> part. use the below code and...
Removed the <br> part. use the below code and comment
#!/usr/bin/bash
/usr/sbin/sendmail -oi -t <<EOF
From: abc@xyz.com
To: def@xyz.com
Subject: GAP Report
Content-Type: text/html;...
4,303
Posted By Scrutinizer
You cannot use a filename and a redirect like...
You cannot use a filename and a redirect like that. Try:
#!/usr/bin/bash
/usr/sbin/sendmail -oi -t <<EOF
From: abc@xyz.com
To: def@xyz.com
Subject: GAP Report
Content-Type: text/html;...
4,303
Posted By Don Cragun
You haven't said what OS you're using. If you...
You haven't said what OS you're using. If you using Solaris/SunOS, change awk to /usr/xpg4/bin/awk in the script.
4,303
Posted By SriniShoo
awk 'BEGIN{print "<pre>"}1' ORS='<br>'...
awk 'BEGIN{print "<pre>"}1' ORS='<br>' ${Filename} <<EOF | /usr/sbin/sendmail -oi -t
From: ${MAILFROM}
To: ${MAILTO}
Subject: $SUBJECT
Content-Type: text/html; charset=us-ascii...
4,303
Posted By RavinderSingh13
Hello sdosanjh, Could you please try...
Hello sdosanjh,

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


cat - ${Filename} <<EOF | /usr/sbin/sendmail -oi -t
From: ${MAILFROM}
To: ${MAILTO}
Subject: $SUBJECT...
Showing results 1 to 25 of 66

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