Mourning the loss of our friend, WhitPhil.
Welcome to Tech Support Guy!
Read our
Welcome Guide
or take a minute to watch the video below!
Join
Tour
Login
Join for free!
Forgot your username or password?
Username
Password
Save?
Search
Home
Forums
Library
News
Store
Donate
Security & HJT
Software & Hardware
Operating Systems
Internet & Networking
General Tech
Community
Linux and Unix
Tag Cloud
access
audio
black screen
blue screen
boot
bsod
connection
crash
dell
desktop
driver
drivers
dvd
email
error
excel
excel 2003
firefox
hard drive
hardware
hdmi
hijackthis
internet
keyboard
laptop
malware
monitor
network
networking
outlook
problem
recovery
router
safe mode
screen
slow
sound
spyware
trojan
upgrade
vba
video
virus
vista
vundo
windows
windows 7
windows vista
windows xp
wireless
Search
Search for:
Linux and Unix
All Forums
Tech Support Guy Forums
>
Operating Systems
>
Linux and Unix
>
Solved: Sed Ksh Question
Tip:
Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]
Computer problem?
Tech Support Guy is completely free -- paid for by advertisers and donations.
Click here to join today!
If you're new to Tech Support Guy, we highly recommend that you visit our
Guide for New Members
. Enjoy!
Thread Tools
surfnschultz
Senior Member with 191 posts.
Join Date: Nov 2003
01-Jun-2005, 01:23 PM
#1
Solved: Sed Ksh Question
I am trying to check keyboard input of the value y
echo " Please enter 1 or 2 to proceed /c"
read dec
if ($dec == y) then
if ($dec ~ y) then
if ($dec -eq y) then
I tried all these different things and all these fail saying the command is not correct. So help me out here How would I check a input of y ???
echo " Please enter 1 or 2 to proceed /c"
read dec
if ($dec -eq 1) then
This above works when I ask for an input of a numeric value like a 1 or 2 but when I substitute the y in the logical function/check it fails. Why???
Register for free to hide this ad!
tsunam
Senior Member with 1,246 posts.
Join Date: Sep 2003
Experience: Linux~su
01-Jun-2005, 05:08 PM
#2
this is the perfect time for a case statement
case $pornum in
y)
what you want it to do;;
n)
what you want it to do;;
esac
Note: I haven't tested to see if the case will work but should.
Last edited by tsunam : 01-Jun-2005
05:41 PM
.
surfnschultz
Senior Member with 191 posts.
Join Date: Nov 2003
01-Jun-2005, 05:50 PM
#3
gotta bail out right now, but I'll look at this more in the am. Thanks again Tsunam I really appreciate all your help on this stuff.
surfnschultz
Senior Member with 191 posts.
Join Date: Nov 2003
02-Jun-2005, 05:06 PM
#4
Worked like a charm. Once again TSUNAM you are the MAN!!!!!!
THANK YOU so much for all the help you have provider me. I am so stoked to have this community it has been a blessing.
tsunam
Senior Member with 1,246 posts.
Join Date: Sep 2003
Experience: Linux~su
02-Jun-2005, 05:24 PM
#5
Glad to be of help. Agree with the community being a blessing, I've learned a good ammount from the people here.
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to
join for free
. Need help getting started? Check out our
Welcome Guide
.
Smart Search
Find your solution!
«
Previous Thread
|
Linux and Unix
|
Next Thread
»
Currently Active Users Viewing This Thread: 1
(0 members and 1 guests)
WELCOME TO TECH SUPPORT GUY!
Are you looking for the solution to your computer problem?
Join our site today
to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our
Welcome Guide
to get started.
Thread Tools
Show Printable Version
Email this Page
Twitter!
|
Podcast
|
Mobile
|
Advertise
-- Khaki
-- Classic Blue
-- Gray Night
Contact Us
-
HelpOnThe.Net
-
Archive
-
Terms of Service
-
Top
You Are Using:
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 11:27 PM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.