Mourning the loss of our friend, WhitPhil.
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Linux and Unix
Tag Cloud
access audio black screen blue screen boot bsod connection crash dell desktop drivers dvd email error excel excel 2003 firefox hard drive hardware hijackthis internet keyboard laptop malware monitor motherboard network networking outlook problem ram recovery router safe mode screen slow sound spyware tdlwsp.dll trojan vba video virus vista vundo windows windows 7 windows vista windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
Solved: user input and KSH scripts

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

Closed Thread
 
Thread Tools
surfnschultz's Avatar
Senior Member with 191 posts.
 
Join Date: Nov 2003
23-Feb-2005, 06:10 PM #1
Solved: user input and KSH scripts
How can I get a user to input information, and have my script use the input data.

trying to atuomate a ksh script and it would be nice if asked for the input.
Squashman's Avatar
Distinguished Member with 14,984 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: IIAHYAYCESA,YAADA!
23-Feb-2005, 06:43 PM #2
I would assume it is the same in all shells.

read variable_name
surfnschultz's Avatar
Senior Member with 191 posts.
 
Join Date: Nov 2003
23-Feb-2005, 06:50 PM #3
Thumbs up good deal got it
lwdsquashman you were right on, was curious about prompting user so here is the finished script. It works well.

echo $line
echo "A 3 digit port number will kill all flip screens"
echo $line
echo "A 4 digit port number will kill ONLY that flip screen"
echo $line
echo "Please enter the 3 or 4 digit port number you want to clear: \c"

read portnum

for spid in $(ps -ef | grep "facet "$portnum | awk {'print$2'})

do

kill -9 $spid 2> /dev/null

done

echo All Processes for port $portnum have been cleared



So again the help here is awesome and very helpful. It is so nice to see this kind of help in this day and age of profit profit profit. I am going to approach my company about giving a good donation for this group.


Life is like a bubble don't let it pop.
Squashman's Avatar
Distinguished Member with 14,984 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: IIAHYAYCESA,YAADA!
23-Feb-2005, 07:11 PM #4
So how do you like working on AIX. I have never gotten a chance to. We have two AIX boxes where I work but the admin will not let me touch them.
surfnschultz's Avatar
Senior Member with 191 posts.
 
Join Date: Nov 2003
01-Mar-2005, 04:36 PM #5
AIX is good NOT great but good
Did some sysadmin when I worked at NASA on a few rs6000. they have one here they run the POS system on so I doing some automation stuff to eliminate a ton of manual work they do daily. If you get a chance help me out on my latest post. I am trying to read a file and then edit a line with values from the file. Wroking on it not getting any where probably just about to bust out and solved it. Yeah RIGht!

I like UNIX all flavors my personal best SGI IRIX I had many machines run for years without a single reboot needed. Took a while to get them stable but once I got them good they worked perfectly for years with little or no intervention, now if I could only say that about Solaris I struggled for years trying to get a good stabel Sun server, they would go for about 30-60 days and then something would crap out. Longest up tiem I saw for a Solaris server was 6 months.
Closed Thread Bookmark and Share

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!



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


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 05:07 PM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.