The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
help me in sending parameters from sqlplus script to unix shell script Hara Shell Programming and Scripting 2 01-29-2008 12:31 PM
Shell Script: want to insert values in database when update script runs ring Shell Programming and Scripting 1 10-25-2007 12:06 AM
here document to automate perl script that call script hogger84 Shell Programming and Scripting 3 10-22-2007 07:15 AM
returning to the parent shell after invoking a script within a script gurukottur Shell Programming and Scripting 5 09-26-2006 04:05 AM
return valuse from child script to parent script borncrazy Shell Programming and Scripting 1 08-20-2004 12:39 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 04-05-2006
Registered User
 

Join Date: Apr 2006
Posts: 3
even odd script

I need a unix script that check for even or odd. EXAMPLE::::

please enter the number to check: 12

the output: This is an even number


it has to have prompts.
Forum Sponsor
  #2  
Old 04-05-2006
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,609
So,
this is your first post!!!

Welcome to the Forum...

what have you tried so far regarding the problem you had posted

here is something you can start with ...
Code:
# !/usr/bin/ksh

echo "Input number"
read number < /dev/tty
if [ $(($number % 2)) -eq 0 ]
then
  echo "$number is even"
else
  echo "$number is odd"
fi

exit 0
  #3  
Old 04-05-2006
Registered User
 

Join Date: Apr 2006
Posts: 3
1 more plz

Thanks guys.
Hey 2 more.

Iwant to input a file
and i want it to tell me 3 trhings
EXAMPLE:::

INPUT: HW1

I can read the file HW1
I can write the file HW1
I cant execute the file HW1
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 10:57 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0