The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Problem with stack overflow karthikb23 HP-UX 0 03-26-2008 01:02 AM
SCO Openserver 5.0.7 Process table overflow josramon UNIX for Dummies Questions & Answers 0 08-29-2005 11:52 AM
KSH arithmatic Integer overflow vikas_sri Shell Programming and Scripting 2 04-02-2004 09:52 PM
Line overflow?? Peterh UNIX for Dummies Questions & Answers 12 04-17-2002 04:25 AM
Printer buffer overflow AltatemTC UNIX for Dummies Questions & Answers 3 02-02-2002 10:28 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-17-2008
Registered User
 

Join Date: Feb 2008
Location: Holland
Posts: 7
How not to let field overflow ?

Hi All

I ahve a basic script with a screen. Is there anyway that I can make it possible for the user not to type over the ] ie I would like the inpu to be only with the brakcets?

Any suggestions welcome.

eg

Code:
DB name:[           ]

function get_fdb {

   while [[ 1 -eq 1 ]]
   do
      tput cup 9 41
      read FDB
      if [[ -n $FDB ]]
      then
         chkdb ${FDB}

         if [[ $? -eq 0 ]]
         then                                   
            break
         else
            disperr "From DB does not exist" 1
         fi
      fi
   done
}

Last edited by Yogesh Sawant; 04-17-2008 at 08:29 AM. Reason: added code tags
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-22-2008
Registered User
 

Join Date: Apr 2008
Posts: 9
how about a different approach...

simple answer is no!

you could write a script that
1)asks the user to input values for each parameter one by one
2)then recreates the aforementioned file with the user input values - that way they don't even have to open the file in the first place - which is a better way of ensuring that noone trashes the file
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:17 AM.


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

Content Relevant URLs by vBSEO 3.2.0