Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: sdosanjh
6,666
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...
4,432
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...
5,061
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.
4,348
Posted By Neo
Have you considered formatting and sending your...
Have you considered formatting and sending your email message as an HTML file?
2,482
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,417
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,417
Posted By RudiC
Wouldn't a simple sort help?
Wouldn't a simple sort help?
1,417
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,417
Posted By vgersh99
something along these lines? CODE=BY awk...
something along these lines?

CODE=BY
awk -v code="${CODE}" -F. '$3==code' myFile
2,482
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.
2,482
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)
...
2,482
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?
754
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...
851
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...
851
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
14,850
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,002
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";
828
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
6,759
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...
6,759
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

...
3,465
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;...
3,465
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;...
3,465
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.
3,465
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...
3,465
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

 

Featured Tech Videos

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