Operating System - HP-UX
1748051 Members
4925 Online
108758 Solutions
New Discussion юеВ

Re: Dam script will not work - ;^0

 
SOLVED
Go to solution
Paula J Frazer-Campbell
Honored Contributor

Dam script will not work - ;^0

Hi to all

I have written a new script but no matter how I try it will not work.

I have set it to 755 and it is owned by me but still refuses to carry out its commands.

Any suggestion or other scripts gratefully received.

---------------- Cut here----------------
#/bin there done that
##########################################
# One for us :- ;^) PJFC Sep 2001
##########################################
# The next bit
# Age
a=`cat /usr/sysadmin | awk ?{print $1}
if `echo $a != 21`
then a=21
fi
##########################################
# Sex
b= `cat /usr/sysadmin | awk ?{print $2}?
if `echo $b != ?A lot?`
then b=?Sex god?
fi
##########################################
# Income
c= `cat /usr/sysadmin | awk ?{print $3}?
if `echo $c != ?Not Enough?`
then b= ?current x 3?
fi
--------------Cut here-------------------


Paula
If you can spell SysAdmin then you is one - anon
33 REPLIES 33
Sridhar Bhaskarla
Honored Contributor

Re: Dam script will not work - ;^0

Paula...


Are you missing a quote at the end of
your a's definition??

b's definition.. c' definition also...


a=`cat /usr/sysadmin | awk '{print $1}'`

Try with these correct quotes for other variable settings also.

-Sri

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Sridhar Bhaskarla
Honored Contributor

Re: Dam script will not work - ;^0

Hmmm... Lemme try it...

#Aged
a=`cat /usr/sysadmin |awk '{print $1}'`
if [ $a != 21 ]
then
a=21
fi

#Sexed

b=`cat /usr/sysadmin|awk '{print $2}'`
if [ "$b" = "A lot" ]
then
b="Sex God"
fi

#Incame

c=`cat /usr/sysadmin |awk '{print $3}'`
if [ "$c" != "Not Enough" ]
then
b="current x 3"
fi

try this and see if it works?.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Paula J Frazer-Campbell
Honored Contributor

Re: Dam script will not work - ;^0

Hi Sridhar

I have put the quote in but still problems

Read the script and what it is trying to do --

It is just for fun.

#/bin there done that
##########################################
# One for us :- ;^) PJFC Sep 2001
##########################################
# The next bit
# Age
a=`cat /usr/sysadmin | awk ?{print $1}
if `echo $a != 21`
then a=21
fi
##########################################
# Sex
b= `cat /usr/sysadmin | awk ?{print $2}?`
if `echo $b != ?A lot?`
then b=?Sex god?
fi
##########################################
# Income
c= `cat /usr/sysadmin | awk ?{print $3}?
if `echo $c != ?Not Enough?`
then c= ?current x 3?
fi


xxx

Paula
If you can spell SysAdmin then you is one - anon
A. Clay Stephenson
Acclaimed Contributor

Re: Dam script will not work - ;^0

Methinks Paula is grinning us.
If it ain't broke, I can fix that.
Paula J Frazer-Campbell
Honored Contributor

Re: Dam script will not work - ;^0

It looks like we might be getting there


Paula
If you can spell SysAdmin then you is one - anon
John Poff
Honored Contributor

Re: Dam script will not work - ;^0

Hmmm,

I get the following message when I type in 'sex':

sex: not found

Sounds about right.

The multiplier for your salary seems low. I'd try upping it to x 5.

:)

JP
Sridhar Bhaskarla
Honored Contributor

Re: Dam script will not work - ;^0

Hmmmmmmmmm!!!!!

See meee :-(
You may be disappointed if you fail, but you are doomed if you don't try
Paula J Frazer-Campbell
Honored Contributor

Re: Dam script will not work - ;^0

Hi John

I have tried the x5 but all I get is: -

Insufficient recourses

I have looked in money.log and the last entry is a negative value could this be the problem.


>>;-0

paula


If you can spell SysAdmin then you is one - anon
Patrick Wallek
Honored Contributor

Re: Dam script will not work - ;^0

Let's see now:

Step 1: We should all be 21
Step 2: We should all be sex gods or goddesses
Step 3: We should all be making triple what we are making now

Sounds good to me!!!!!!!!!