UNIX and Linux

Quick Q ...

41 to 58 of 58 messages
The Evil Pixie    pirate
07/08/2006 at 21:16
this is another reason why I love this forum!!

It's not just runners it's a bunch of helpful and friendly folks happy to help in any way they can!
07/08/2006 at 21:30
Some function/command either produces some actual results, or alternatively the response "N/A" for not applicable or something. This function is checking for this anomalous result. A real unix programmer would ensure the command returned no output and an exit code that reflected that so that it could be tested for in a script. Database programmers or windows programmers would probably output "sorry fred, but couldn't find anything" instead, so you'd have to write a special case for each program...

The Evil Pixie    pirate
07/08/2006 at 21:34
these are database programmers!!

Just scanned the document further and they use awk later!

You are really helpful foo bar! Thank you!!
Mwah!!
The Evil Pixie    pirate
08/08/2006 at 07:47
right today I will be going through the doc in a less formal way ... getting a basic understanding of everything without looking at every switch.
Once I have done that I will look harder at the code 'cos that was fun!!
I won't have time to look at ever line before tomorrow evening!

I still expect to ask some questions mind!
The Evil Pixie    pirate
08/08/2006 at 09:21
Given:

EMAIL_TEXT=/tmp/all_refresh$$
touch ${EMAIL_TEXT}
chmod 700 ${EMAIL_TEXT}

create an empty file called email_text and set the read/write/execute properties for the owner only?
08/08/2006 at 09:26
it creates an empty file called /tmp/all_refreshNNNNN where NNNNN is the current process id (try echo $$ at the command line) so that it has a roughly unique name. It then changes the permission as you say. However, it's an insecure way of doing this for various reasons.
The Evil Pixie    pirate
08/08/2006 at 09:31
cool!
The next bit is a case statement that adds various text to this file so that makes perfect sense; file is then e-mailed somewhere!
Cool!
The Evil Pixie    pirate
08/08/2006 at 10:07
does the fi in the following example imply the end of the IF statement?

if [[ $NO_OF_ATTEMPTS = $WAIT_RETRIES ]]
then
core_check_for_error 1 "Script stopped as number of retries ($WAIT_RETRIES) exceeded"
fi
The Evil Pixie    pirate
08/08/2006 at 10:42
and ....

while [[ ${OLD_DATE} -eq ${NEW_DATE} ]]

what does the -eq mean?
The Evil Pixie    pirate
08/08/2006 at 10:44
have located that the fi is the end of the IF and that they esac is the end of case!!

I think that -eq is the same as equal to as in checking that the old date is the same as the new date

Is this right?
08/08/2006 at 12:10
yes, you've got the if/fi and case/esac right. [[ is actually a builtin command used for conditional expressions. If you have a linux box for example, you could type "man bash" and then search for -eq using /-eq. So -eq is an arithmetic comparison operator.
The Evil Pixie    pirate
08/08/2006 at 12:12
thanks!!!
The Evil Pixie    pirate
09/08/2006 at 09:24
well today is the day!
Last minute checking and confirming and making sure I have some good notes as my voice is going!!
interview at 5.30
other person is in tomorrow so will know Friday
So hope I get this!
Thanks for all your help!
The Evil Pixie    pirate
10/08/2006 at 07:36
All my notes I made these last few helped so thanks for everything guys!!

I remembered what foo bar said about improving the grep -i to use the -q switch and not /dev/null and that went down well!! Made a point that they might update the script!
Was very quick, about an hour, because I had written down and told them most of the things they were going to ask me! Had to write it down as my voice was flanky and I thought it was going to go!!!
seeing the other chap tonight so should know friday
either way I know I need a new job and something to challenge me - I've had so much fun actually working!!
The Evil Pixie    pirate
11/08/2006 at 13:43
Got the Job!!
Thanks guys!
12/08/2006 at 16:15

Excellent, Sorted !
13/08/2006 at 17:09
well done EP, did you get the email i sent you with the sites
13/08/2006 at 17:34
Foo Bar: ROFL to the comment about real unix programmers and exist codes. Ahh, I have so many happy c/unix memories ;-)

Recently, I've wanted to get back into Linux, so this weekend I've been installing Kubuntu on my home PCs. I've a few and was wondering if there is any OS-level software to create a cluster??

We'd love you to add a comment! Please login or take half a minute to register as a free member
41 to 58 of 58 messages
Forum Jump  

RW competitions

RW Forums