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 acer asus bios bsod computer crash dns driver drivers error ethernet excel freeze gaming google hard drive hardware hdmi internet laptop mac malware memory monitor motherboard mouse network printer problem ram registry router server slow software sound svchost.exe trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
Solved: user input and KSH scripts

Reply  
Thread Tools
surfnschultz's Avatar
Member with 191 posts.
 
Join Date: Nov 2003
23-Feb-2005, 07: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
Trusted Advisor with 18,706 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: Bocks of Rox
23-Feb-2005, 07:43 PM #2
I would assume it is the same in all shells.

read variable_name
surfnschultz's Avatar
Member with 191 posts.
 
Join Date: Nov 2003
23-Feb-2005, 07: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
Trusted Advisor with 18,706 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: Bocks of Rox
23-Feb-2005, 08: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
Member with 191 posts.
 
Join Date: Nov 2003
01-Mar-2005, 05: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.
Reply

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.

Search Tech Support Guy

Find the solution to your
computer problem!




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



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 10:36 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.