- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Dam script will not work - ;^0
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 11:09 AM
09-05-2001 11:09 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 11:20 AM
09-05-2001 11:20 AM
Re: Dam script will not work - ;^0
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 11:26 AM
09-05-2001 11:26 AM
Re: Dam script will not work - ;^0
#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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 11:26 AM
09-05-2001 11:26 AM
Re: Dam script will not work - ;^0
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 11:28 AM
09-05-2001 11:28 AM
Re: Dam script will not work - ;^0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 11:29 AM
09-05-2001 11:29 AM
Re: Dam script will not work - ;^0
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 11:31 AM
09-05-2001 11:31 AM
Re: Dam script will not work - ;^0
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 11:35 AM
09-05-2001 11:35 AM
Re: Dam script will not work - ;^0
See meee :-(
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 11:36 AM
09-05-2001 11:36 AM
Re: Dam script will not work - ;^0
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 11:38 AM
09-05-2001 11:38 AM
Re: Dam script will not work - ;^0
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!!!!!!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 11:40 AM
09-05-2001 11:40 AM
Re: Dam script will not work - ;^0
make more money
Make: Don't know how to make more. Stop.
Oops. Looks like we're out of luck! ;)
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 11:46 AM
09-05-2001 11:46 AM
Re: Dam script will not work - ;^0
I wish you could get this script to work, though I'd rather be 25. Auto Insurance is cheaper that way. ;)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 12:01 PM
09-05-2001 12:01 PM
Re: Dam script will not work - ;^0
I see a problem where you are using comparison operatos. In Shell there two types of comparison operatos one for numberics and other for strings.
If you are comparing strings use ==, !=, > , < etc.,
If you are comparing numerics use -gt,-ne,-lt,-eq etc.
The script is modified to work.
Thanks,
Madhu
--------
#/bin there done that
##########################################
# One for us :- ;^) PJFC Sep 2001
##########################################
# The next bit
# Age
a=`cat /usr/sysadmin | awk ?{print $1}?`
if test $a ?eq 21
then a=21
fi
##########################################
# Sex
b= `cat /usr/sysadmin | awk ?{print $2}?
if test ?$b? != ?A lot?
then b=?Sex god?
fi
##########################################
# Income
c= `cat /usr/sysadmin | awk ?{print $3}?`
if test ?$c? != ?Not Enough?
then b= ?current x 3?
fi
--------------Cut here-------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 12:08 PM
09-05-2001 12:08 PM
Re: Dam script will not work - ;^0
The errors are:-
age = "You must be joking"
sex = "You are already at limit"
income = "Export cv/resume"
;^0
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 12:10 PM
09-05-2001 12:10 PM
Re: Dam script will not work - ;^0
This one would be good enough for me...
#/usr/bin/beer #(the little known beer shell)
#####################################
# Beer
beer=0
drinking=TRUE
while [ drinking = TRUE ]
do
if [ beer -ne 24 ]
then
((beer+=1))
else
sleep 3600
beer=0
done
Cheers!
-Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 12:13 PM
09-05-2001 12:13 PM
Re: Dam script will not work - ;^0
Your script has the following statment
c= ?current x 3?
Here the variable current doesn't have any value neither initialised nor assigned.
Are you trying to multiply current x 3 or are you trying to assign a string "current x 3" ?
...Madhu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 12:13 PM
09-05-2001 12:13 PM
Re: Dam script will not work - ;^0
You could perhaps use a get and make in your script.
i.e.
if beer = 0
then get more beer
fi
or
if beer =0
then make beer
fi
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 12:16 PM
09-05-2001 12:16 PM
Re: Dam script will not work - ;^0
sleep 31536000
and that should fix it for now.
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 12:16 PM
09-05-2001 12:16 PM
Re: Dam script will not work - ;^0
Yes I spotted that and defined current as 1 in the script.
;-)
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 12:17 PM
09-05-2001 12:17 PM
Re: Dam script will not work - ;^0
beer | user | bathroom
Of course, there is always my favorite little script (courtesy of thinkgeek.com - they have it on a t-shirt that I'd love to have!)
cd /pub
more beer
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 12:18 PM
09-05-2001 12:18 PM
Re: Dam script will not work - ;^0
...Madhu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 12:18 PM
09-05-2001 12:18 PM
Re: Dam script will not work - ;^0
Judging from the responses (and I admit, I first looked at this post from a syntatic view too!) I can't help but wonder what this says about us! ;-)
Timothy, loops such as those you suggest are detrimental to processors ...
Paula, we can always count on you to provide much needed levity in an otherwise all too serious day!
Regards to all!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 12:20 PM
09-05-2001 12:20 PM
Re: Dam script will not work - ;^0
Why not do a sleep until
ie.e.
Sleep until interested
or
Sleep until retirement
or
Sleep until sex = possible
or
Sleep until lottery = win
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 12:22 PM
09-05-2001 12:22 PM
Re: Dam script will not work - ;^0
...Madhu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2001 12:24 PM
09-05-2001 12:24 PM
Re: Dam script will not work - ;^0
This always work for me
==========Cut here============
while true
do
sleep 1
done
==========Cut here============
-Ramesh