Sponsored Content
Top Forums Shell Programming and Scripting Error to Read Input from command line Post 302907708 by rocking77 on Tuesday 1st of July 2014 08:02:11 AM
Old 07-01-2014
Thanks for your replies this is ksh .Batte I used your sytax .


Code:
 
while true ;do
        
read  yn? "Do You Wish To Take Database Backup for $DB?? " 
 case $yn in
 [Yy]*) echo " YES take backup ";;
        [Nn]*) echo " NO BACKUP " ;;
         *) echo "Please Answer Yes OR NO " ;;
esac
done

I don't see its running fine .I can see more errors though its taking inputs from command line .May be i should add break in each choice to come out of the loop ?


Code:
 
./Config.sh[56]: Do You Wish To Take Database Backup for ?? : This is not an identifier.
Please Answer Yes OR NO
y
./Config.sh[56]: Do You Wish To Take Database Backup ?? : This is not an identifier.
 YES take backup
./Config.sh[56]: Do You Wish To Take Database Backup ??  : This is not an identifier.
Please Answer Yes OR NO
n
./Config.sh[56]: Do You Wish To Take Database Backup ??   : This is not an identifier.
 NO BACKUP
./Config.sh[56]: Do You Wish To Take Database Backup ??  : This is not an identifier.
Please Answer Yes OR NO
cancel
./Config.sh[56]: Do You Wish To Take Database Backup for ?? : This is not an identifier.
Please Answer Yes OR NO

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

read a file as input and pass each line to another script

Hi, I am trying to write a ftp script which will read a file for filenames and ftp those files to another server. Here's my ftp script, but it's scanning the current directory for file names. My question is how can I pass multiple files (these files will have the name of data files that need to... (0 Replies)
Discussion started by: sajjad02
0 Replies

2. Shell Programming and Scripting

How can I send the input of a read line command through a shell script

Hi All, I wish to automate the unix command 'su' through a shell script. I would like to pass the content of a file as password to 'su' command. My script is as below, #! /bin/sh su userA while read line do rpm -ivh $line done < pwd.txt where pwd.txt contains the password of... (6 Replies)
Discussion started by: little_wonder
6 Replies

3. UNIX for Dummies Questions & Answers

How to read a line of text from user input?

Hiii I wanna a read a line of text from standard input. The user enter data like this way name phone_no month1_salary month2_salary that is user enter the name ,phone no and salary of 2 months in a single line by giving spaces. I wanna add the 3rd and 4th fields ...ie add both... (4 Replies)
Discussion started by: krishnampkkm
4 Replies

4. Shell Programming and Scripting

sed to read line by line and input into another file

I have two files. Fileone contains text string one text string two text string three Filetwo contains Name: Address: Summary: Name: Address: Summary: Name: Address: Summary: I would like to use sed to read each line of file one and put it at the end of the summary line of file... (3 Replies)
Discussion started by: dolacap
3 Replies

5. Shell Programming and Scripting

filtering input from read command

I need help understanding a script I'm modifying which someone else has written. Basically I’m looping through a buffer that holds records fetched from a database query. I need a way to separate the primary key values from other attributes in the result. Heres the code: BUFF=buffer_file >... (5 Replies)
Discussion started by: d3mon_spawn
5 Replies

6. Shell Programming and Scripting

Read input while executing the command

Hi everyone, i have made a very simple script where it reads the user input and converts the number from celcius to faranheit but instead of running the command and prompting the user for input I want to be able to simply enter a number at the end of the command to run the script. ex. instead of... (1 Reply)
Discussion started by: subway69
1 Replies

7. Shell Programming and Scripting

Print output and read input on same line

How do I print output and read input on the same line in ksh? echo Hello, what is your name? read name (1 Reply)
Discussion started by: robin_simple
1 Replies

8. Shell Programming and Scripting

Read input file with in awk script not through command line

Hi All, Do we know how to read input file within awk script and send output toanother log file. All this needs to be in awk script, not in command line. I am running this awk through crontab. Cat my.awk #!/bin/awk -f function test(var){ some code} { } END { print"test code" } (5 Replies)
Discussion started by: random_thoughts
5 Replies

9. Shell Programming and Scripting

Script to read command line input and change it to some form

Hi, I want to write a small code in which script changes command line input to some form. Example script.sh a1 a2 a3 a4 ..... output should be "a1|a2|a3|....." Number of inputs in command line can be any variable (2 Replies)
Discussion started by: Raza Ali
2 Replies

10. UNIX for Dummies Questions & Answers

Input for read command

Hello, I want to use the read command in order to input a keyword from the keyboard. I then want to use this keyword in a grep command. How to I input a phrase as a keyword? For example if I use read keyword "today is" and then use grep, I get "No such file or directory" error. (6 Replies)
Discussion started by: FelipeAd
6 Replies
BACKUP_DBVERIFY(8)					       AFS Command Reference						BACKUP_DBVERIFY(8)

NAME
       backup_dbverify - Checks the integrity of the Backup Database

SYNOPSIS
       backup dbverify [-detail] [-localauth]
	   [-cell <cell name>]
	   [-help]

       backup db [-d] [-l] [-c <cell name>] [-h]

DESCRIPTION
       The backup dbverify command checks the integrity of the Backup Database. The command's output indicates whether the Backup Database is
       damaged (data is corrupted) or not. If the Backup Database is undamaged, it is safe to continue using it. If it is corrupted, discontinue
       any backup operations until it is repaired.

CAUTIONS
       While this command runs, no other backup operation can access the Backup Database; the other commands do not run until this command
       completes. Avoid issuing this command when other backup operations are likely to run. The backup savedb command repairs some types of
       corruption.

OPTIONS
       -detail
	   Reports the number of orphaned blocks found, any inconsistencies, and the name of the server machine running the Backup Server that is
	   checking its copy of the database.

       -localauth
	   Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. The backup command interpreter presents it to
	   the Backup Server, Volume Server and VL Server during mutual authentication. Do not combine this flag with the -cell argument. For more
	   details, see backup(8).

       -cell <cell name>
	   Names the cell in which to run the command. Do not combine this argument with the -localauth flag. For more details, see backup(8).

       -help
	   Prints the online help for this command. All other valid options are ignored.

OUTPUT
       The command displays one of the following two messages:

       Database OK
	   The database is undamaged and can be used.

       Database not OK
	   The database is damaged. You can use the backup savedb command to repair many kinds of corruption as it creates a backup copy.  For
	   more detailed instructions, see the OpenAFS Administration Guide chapter about performing backup operations.

       The -detail flag provides additional information:

       o   The number of orphan blocks found. These are ranges of memory that the Backup Server preallocated in the database but cannot use.
	   Orphan blocks do not interfere with database access, but do waste disk space. To free the unusable space, dump the database to tape by
	   using the backup savedb command, and then restore it by using the backup restoredb command.

       o   Any inconsistencies in the database, such as invalid hostnames for Tape Coordinator machines.

       o   The name of the database server machine on which the Backup Database was checked, designated as the "Database checker". For a detailed
	   trace of the verification operation, see the /var/log/openafs/BackupLog file on the indicated machine. You can use the bos getlog
	   command to display it.

EXAMPLES
       The following command confirms that the Backup Database is undamaged:

	  % backup dbverify
	  Database OK

       The following command confirms that the Backup Database is undamaged and that it has no orphan blocks or invalid Tape Coordinator entries.
       The Backup Server running on the machine "db1.abc.com" checked its copy of the Database.

	  % backup dbverify -detail
	  Database OK
	  Orphan blocks 0
	  Database checker was db1.abc.com

PRIVILEGE REQUIRED
       The issuer must be listed in the /etc/openafs/server/UserList file on every machine where the Backup Server is running, or must be logged
       onto a server machine as the local superuser "root" if the -localauth flag is included.

SEE ALSO
       BackupLog(5), backup(8), backup_restoredb(8), backup_savedb(8), bos_getlog(8)

COPYRIGHT
       IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.

       This documentation is covered by the IBM Public License Version 1.0.  It was converted from HTML to POD by software written by Chas
       Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.

OpenAFS 							    2012-03-26							BACKUP_DBVERIFY(8)
All times are GMT -4. The time now is 08:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy