Search Results

Search: Posts Made By: maverick72
2,002
Posted By Corona688
Eh, it's like log files. If you don't know what...
Eh, it's like log files. If you don't know what you're looking for, you don't know what's safe to throw away. At least this is temporary...
2,002
Posted By Don Cragun
It would seem that: tail -1 log | grep up ...
It would seem that:
tail -1 log | grep up
could be discarding diagnostics indicating why rndc failed. Is there some reason why something like:
rndc -k ${RNDC_KEY} -s ${DNS_SERVER} status >...
2,002
Posted By Don Cragun
Probably something more like: rndc -k...
Probably something more like:
rndc -k ${RNDC_KEY} -s ${DNS_SERVER} status > $some_temp_file 2>&1
tail -1 $some_temp_file | grep upor:
rndc -k ${RNDC_KEY} -s ${DNS_SERVER} status > $some_temp_file...
2,002
Posted By Corona688
If rndc is completely unable to give you any...
If rndc is completely unable to give you any information except the return code, you may need to start printing statements into a file for you to read later.
2,002
Posted By Corona688
Sometimes gives you what error? Knowing that'd...
Sometimes gives you what error? Knowing that'd be helpful.

Double-check that the contents of ${DNS_MASTER_SERVERS[@]} are always what you want. There could be something wonky ending up in there...
5,007
Posted By Corona688
The reason it doesn't give exit status for this...
The reason it doesn't give exit status for this is because it's supposed to give you the exit status of whatever happened on the remote end. This makes it hard to tell the difference between the...
3,888
Posted By Chubler_XL
Lets look at the main code part first: ...
Lets look at the main code part first:


/^Outgoing update/ {A=procDNS(A)}
{A=A "\n" $0}Line 2 above is building up variable A with your file contents, it does this by appending A with a newline...
3,888
Posted By Chubler_XL
How about this: awk ' function...
How about this:

awk '
function getfield(str, pattern, trim) {
if(!match(str, pattern)) return ""
return substr(str,RSTART+trim,RLENGTH-trim)
}
function procDNS(rec) {
...
3,888
Posted By RudiC
That wouldn't work with the samples you've given...
That wouldn't work with the samples you've given unless you take additional action. Using both files and printing NF and, if available, FAIL: Start
0
4
3
0
4
FAIL: CNAME already exist
4
FAIL:...
3,888
Posted By RudiC
I'm not sure I understand what you're after....
I'm not sure I understand what you're after. Anyhow, some comments:
- The only difference between the two files is > update failed:...
2,119
Posted By neutronscott
read splits the line into fields like word...
read splits the line into fields like word splitting (using IFS) and assigns to each name given. It is common practice to use _ as a place holder for unused fields. If I left out the final _ and the...
2,119
Posted By RudiC
That will read into 5 variables, of which the...
That will read into 5 variables, of which the dummy variable "_" will consume items 2, 3, and 5+. KEY will assume the first field's content, and VALUE the fourth's.
2,119
Posted By neutronscott
what if you let bash read it into separate...
what if you let bash read it into separate variables?


while read -r key _ _ value _; do
echo "$key $value"
done < <(find ... -exec cat {} +)
1,935
Posted By Corona688
Well, echo sometimes does odd things on certain...
Well, echo sometimes does odd things on certain shells -- some expand escape sequences, some don't, some support options, some don't -- but printf "%s" "string" is pretty much guaranteed the same...
1,046
Posted By RudiC
I'm guessing only that you want to use the...
I'm guessing only that you want to use the commands' exit codes in your first script. Then you should also print them using e.g. echo $? in the assignment statements. What you could do to clean...
1,046
Posted By Scrutinizer
First thing I notice is the closing braces of the...
First thing I notice is the closing braces of the functions. They should either be on a new line or preceded by a semi-colon.
13,569
Posted By Corona688
As I explained, I don't use args. I write it...
As I explained, I don't use args. I write it into the script's standard input.
13,569
Posted By Corona688
That's how my scheme works too. The php page...
That's how my scheme works too. The php page writes into the connection, the script reads it, and it gets the variables that way.
13,569
Posted By Corona688
I take it you're able to modify the contents of...
I take it you're able to modify the contents of x.sh to your pleasing?

I automated a PHP page which grabbed data via ssh by reading text from stdin via read whenever an argument wasn't present. ...
13,569
Posted By Corona688
I don't understand how that script could possibly...
I don't understand how that script could possibly do anything, at all, ever. It's nothing but a here-document.

Less jokingly, post the complete script please, my crystal ball is not functioning...
13,569
Posted By Corona688
No, I mean -- what are the contents of x.sh? The...
No, I mean -- what are the contents of x.sh? The shell script that gets executed on login?
13,569
Posted By bakunin
Yes, "-c" is one argument and the rest is the...
Yes, "-c" is one argument and the rest is the second. Your problem is not the passing of the parameters but the splitting of them.

You could emulate the splitting along IFS characters inside your...
13,569
Posted By Corona688
What are the contents of x.sh? If it's mangling...
What are the contents of x.sh? If it's mangling arguments, it will have to be worked around, and one can hardly tell that without knowing what it is.
13,569
Posted By blackrageous
It would help if you show the script. How are...
It would help if you show the script. How are you executing this? What is the command you send over to the server. Since you didn't supply the script I created x.sh that just outputs argument...
1,667
Posted By MadeInGermany
I normally use this method remove_host () { ...
I normally use this method
remove_host () {
cp -p $CONFIG_FILE $CONFIG_FILE.old &&
awk '$1!=ip' ip="$IP_ADDRESS" $CONFIG_FILE.old > $CONFIG_FILE
}

Also avoids a theoretical problem with dots...
Showing results 1 to 25 of 42

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