Sponsored Content
Special Forums Windows & DOS: Issues & Discussions Validation in user input in batch script Post 302766153 by Yoda on Monday 4th of February 2013 09:52:15 AM
Old 02-04-2013
To check if numeric:
Code:
SET /A EV=RC
if %EV% EQU %RC% (
	echo Numeric
) else (
	echo Non-numeric
)

To compute length:
Code:
echo.%RC%>len
for %%a in (len) do set /a len=%%~za -2
echo %len%

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Input validation ?

I am trying to validate user input, at the moment what i have is as below :- echo "\n\tPlease, enter package name to import: \c" read PACKAGE So far this works perfect , But if the user does not input any thing it stalls :( What I need is, If the user does not enter the name of the... (9 Replies)
Discussion started by: systemali
9 Replies

2. Shell Programming and Scripting

User Prompt during batch script process

The script below performs an incremental database backup. When the increment backup is out of sequence, the process prompts the user: "Incremental backup out of sequece. Do you wish to continue? Y or N". This script is set to run as a scheduled process in background mode. When the script... (2 Replies)
Discussion started by: bond007jlv
2 Replies

3. Shell Programming and Scripting

Command line user input validation

Hi guys, I have a piece of snippet below which asks the user to input some numbers if isDatasubEnabled && isReconEnabled; then echo "1 = CGT, 2 = Subscriber, 3 = Order Monitor, 4 = Revaluations, 5 = Reconciliation, 6 = All, 7 = Exit" elif isDatasubEnabled &&... (4 Replies)
Discussion started by: pyscho
4 Replies

4. Shell Programming and Scripting

how to do validation the input requirement with if/else

Hello Everyone, I have the following script; ------------------------------------------------------------------ #!/bin/ksh set HSC=$1 set SEX=$2 set EXP='export ORACLE_SID=AFISDB' if ($#argv !=2); then echo Usage $0 HSC SEX else date > modify_gender_trace.txt $EXP echo... (5 Replies)
Discussion started by: wingcross
5 Replies

5. Shell Programming and Scripting

Input Validation of comma separated values

Hello all, I am working on a script and have the first part solved of numerical input validation. Below the code validates that the input is a numerical value between 100 and 1000. If not, it errors out. Now I need to be able to read values separated by a comma. For example, instead of my... (5 Replies)
Discussion started by: LinuxRacr
5 Replies

6. Shell Programming and Scripting

Input validation of file

Hi, I'm trying to do input validation for a file. If the user fails to enter a file name, the script should prompt for the file name or exit. I'm using this script to integrate with a bigger script which does ftp of the files which are "read". #!/bin/ksh echo "enter a file name" if then... (16 Replies)
Discussion started by: sam_bd
16 Replies

7. Shell Programming and Scripting

perl: How to improve with minimal validation of its input??

The Code: #!/usr/bin/perl use strict; use warnings; print "Please enter numbers, separated by commas: "; my $data=<STDIN>; chomp $data; my @dataset=split(/,/, $data); my $sum = 0; foreach my $num (@dataset) { $sum += $num; } my $total_nums = scalar(@dataset); my $mean =... (1 Reply)
Discussion started by: 300zxmuro
1 Replies

8. Shell Programming and Scripting

Script interacts with user , based on user input it operates

i have a script which takes input from user, if user gives either Y/y then it should continue, else it should quit by displaying user cancelled. #!/bin/sh echo " Enter your choice to continue y/Y OR n/N to quit " read A if then echo " user requested to continue " ##some commands... (7 Replies)
Discussion started by: only4satish
7 Replies

9. Windows & DOS: Issues & Discussions

Put the numeric validation in user input when value is 5.1.2.3

Hi I need to put the validation in batch script when user will enter the build number it should be numeric.I can put the validation for numeric values but there is .(dot) in number so it would not take it as numeric. Is it possible we can store it in variable and remove the .(dot) from the... (1 Reply)
Discussion started by: anuragpgtgerman
1 Replies

10. UNIX for Dummies Questions & Answers

Input Email ID Validation

Hi Experts, I've a script where users will input the email id. I want to loop the script until the user enter proper email id. Its validating for all condition and error out if any wrong data, but for one condition alone its not erroring out. Capture_EmailID() { echo -e "Please Enter... (1 Reply)
Discussion started by: senthil.ak
1 Replies
ATD(8)							     Linux Programmer's Manual							    ATD(8)

NAME
atd - run jobs queued for later execution SYNOPSIS
atd [-l load_avg] [-b batch_interval] [-d] [-s] DESCRIPTION
atd runs jobs queued by at(1). OPTIONS
-l Specifies a limiting load factor, over which batch jobs should not be run, instead of the compile-time choice of 0.8. For an SMP system with n CPUs, you will probably want to set this higher than n-1. -b Specifiy the minimum interval in seconds between the start of two batch jobs (60 default). -d Debug; print error messages to standard error instead of using syslog(3). -s Process the at/batch queue only once. This is primarily of use for compatibility with old versions of at; atd -s is equivalent to the old atrun command. A script invoking atd -s is installed as /usr/sbin/atrun for backward compatibility. WARNING
atd won't work if its spool directory is mounted via NFS even if no_root_squash is set. FILES
/var/spool/atjobs The directory for storing jobs; this should be mode 700, owner at. /var/spool/atspool The directory for storing output; this should be mode 700, owner at. /etc/at.allow, /etc/at.deny determine who can use the at system. SEE ALSO
at(1), atrun(1), cron(8), crontab(1), syslog(3), at.deny(5), at.allow(5). BUGS
The functionality of atd should be merged into cron(8). local Mar 1997 ATD(8)
All times are GMT -4. The time now is 11:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy