Search Results

Search: Posts Made By: ddreggors
2,354
Posted By ddreggors
tukuyomi is correct, I did not even notice that...
tukuyomi is correct, I did not even notice that you were using "$SERVICE status"... for some reason I thought I saw "$STATUS" which would have been more correct as it contained the output from...
2,354
Posted By ddreggors
If I read this correctly, you only want to...
If I read this correctly, you only want to restart the service if it is stopped.

If that is the case then your issue is the if statement logic...

if [ "$SERVICE status" != 'xinetd is stopped' ]...
Forum: Red Hat 07-21-2013
4,215
Posted By ddreggors
You are looking for conditionals in the spec...
You are looking for conditionals in the spec file:

10.6.2. Using conditional blocks (http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch10s06s02.html)

You may...
Forum: Red Hat 06-15-2012
2,803
Posted By ddreggors
Are you asking how to use pico to edit a file? ...
Are you asking how to use pico to edit a file?
Are you asking which file to edit?

The "Linux root directory" is "/" and there are no login files there. There are also several kinds of "login...
3,203
Posted By ddreggors
In that case you will have to use the ">...
In that case you will have to use the "> newfile.txt" option then copy "newfile.txt" to the old file name.

At least with sed anyway.

Another way would be to adopt the perl method mentioned by...
3,203
Posted By ddreggors
use the "-i" flag for sed when you get the search...
use the "-i" flag for sed when you get the search and replace correct. When using the "-i" flag do not use the "> text2.out" at the end.

That flag is to change the file "in place" so you do not...
3,203
Posted By ddreggors
oops my bad... replace the single quotes in sed...
oops my bad... replace the single quotes in sed with double quotes when using shell variables in search or replace fields:


#!/bin/sh
string1="encoding=\"\""
string2="encoding=\"UTF-8\""
sed...
30,302
Posted By ddreggors
odd... you know to use "expr" here: z=`expr...
odd... you know to use "expr" here:

z=`expr $y - $y1`

and then forget to use it here:

z1=`$z/$y1`

The answer would be:
z1=`expr $z/$y1`

---------- Post updated at 10:14 AM ----------...
1,195
Posted By ddreggors
I know this is not a sed solution but in vim you...
I know this is not a sed solution but in vim you can do a range based search replace. That way you can see what you have done and then undo if you don't want to keep that change..

open file in vim...
3,203
Posted By ddreggors
@fretagi sed command structure when using a...
@fretagi

sed command structure when using a file is:


sed 's/<SEARCH>/<REPLACE>/' <FILENAME>


You have the first part correct just add the filename at the end (without <).

Helpful info...
3,203
Posted By ddreggors
@birei sed can modify file in place as well...
@birei
sed can modify file in place as well with the "-i" (or --in-place) flag.

sed man page clip:
3,203
Posted By ddreggors
Original: #!/bin/sh string1="encoding=""" ...
Original:

#!/bin/sh
string1="encoding="""
string2="encoding="UTF-8"
sed 's/'"$string1"'/'"$string2"'/g'


Needs to be:


#!/bin/sh
string1="encoding=\"\""
string2="encoding=\"UTF-8\""...
2,929
Posted By ddreggors
echo ""|awk "{a=${JUMBO}; printf \"%f\n\", a}" ...
echo ""|awk "{a=${JUMBO}; printf \"%f\n\", a}"

---------- Post updated at 03:14 AM ---------- Previous update was at 01:14 AM ----------

or if you prefer this way:


$ echo "$JUMBO" |awk...
2,929
Posted By ddreggors
Example: $ echo ""|awk '{a=15314.6 +...
Example:


$ echo ""|awk '{a=15314.6 + 16320.6 + 15813.6 + 16835.6 + 19252.1 + 14823.5 + 16577.1 + 15068.1 + 13631 + 18158.1 + 17889.6 + 16835.6 + 15314.6 + 15314.6 + 16320.6 + 17358.6 + 15563.1 +...
2,929
Posted By ddreggors
nope, just doesn't understand what your giving...
nope, just doesn't understand what your giving it:


$ echo "2.53294e+08 + 5" |bc
(standard_in) 1: syntax error


The "e+" (exponential) notation is a bit to complicated for bc. Convert these...
2,929
Posted By ddreggors
I (and bc) do not understand what you want to do...
I (and bc) do not understand what you want to do here.

Are you adding?

$ echo "7 + 3 + 8 + 2 + 2 + 1 + 3 + 83.4 + 8.2 + 4 + 8 + 73 + 90.5" | bc
293.1


you have not given us or bc enough...
6,001
Posted By ddreggors
First Question: There are several ways to...
First Question:


There are several ways to do this, the most common is to write a CGI script that your html page will use as the "Action" of a form. You would need to read up on forms in html,...
4,284
Posted By ddreggors
Try this: --- test5-old.pl 2012-06-12...
Try this:


--- test5-old.pl 2012-06-12 21:38:13.986606410 -0400
+++ test5-new.pl 2012-06-12 21:43:51.468953185 -0400
@@ -2,36 +2,24 @@
#
use strict;
use warnings;
-my (@data, $row,...
4,284
Posted By ddreggors
There are some big errors in there... I see...
There are some big errors in there...

I see where you have tried to adopt some of what I have done but there are some points that you are missing.

Let's start here:


my $outputfile =...
4,284
Posted By ddreggors
To make sure that the lines with "NA" are not...
To make sure that the lines with "NA" are not used simply change:


foreach $row (@data) {
next unless $row =~ /^\d/;
@dataline = split('\s',$row);
next unless...
16,477
Posted By ddreggors
Thanks alister, that is good to know. I have been...
Thanks alister, that is good to know. I have been using tr for years with that syntax and just never have seen any problems. It had always performed as expected. When you mention the shell globbing...
1,747
Posted By ddreggors
The awk line can be far more simple: awk...
The awk line can be far more simple:


awk '/627857272120951075/{print $0}' /var/log/abc.log


what awk is doing is checking each line 1 at a time for the string "627857272120951075", if (and...
16,477
Posted By ddreggors
Hmm man tr on my servers do not show the...
Hmm

man tr on my servers do not show the need for a single or double quote.

I am using RHEL 5.3 and have been using the "[:upper:] [:lower:]" notation for years without quoting them. In fact we...
1,105
Posted By ddreggors
I am not sure I understand, you only want to...
I am not sure I understand, you only want to print the "table2" line but only if it is after a "table1" line AND a "," line?

please show two examples of expected output, one if what you want is...
16,477
Posted By ddreggors
I can't really speak to the inconsistent output...
I can't really speak to the inconsistent output using "[A-Z] [a-z]", however I can say that I have never seen that using this method to go from upper to lower...

echo "NEE"|tr [:upper:] [:lower:]
Showing results 1 to 25 of 155

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