There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
UNIX/Linux
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Operating Systems > UNIX/Linux >
Solved: user input and KSH scripts


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
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 12,604 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
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 12,604 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
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.
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

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 07:54 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.