10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
i had a code where in user will enter a date in yyyymmdd format.. i didnt use any validation for the date and now the problem is if a user enters date instead of month after year it is proceeding with the code..
like if the date is 20120426 and if the user enters 20122604 it... (4 Replies)
Discussion started by: smarty86
4 Replies
2. Shell Programming and Scripting
how to check input date format.
for example $input_date must be in format dd.mm.gg
script is execute like this:
bin/script1.sh 14.12.2009
script1.sh code:
#!/bin/sh
input_date=$1
CMD="/app/si/test/test.sh $input_date"
echo "*****"
$CMD (2 Replies)
Discussion started by: waso
2 Replies
3. UNIX for Dummies Questions & Answers
I'm trying to set up a script that takes user input and validates that the user input was entered correctly.
So far I have this:
while :
do
echo "Please enter your name."
read NAME
if
then
echo "You have not entered a name."
echo... (13 Replies)
Discussion started by: fufaso
13 Replies
4. Shell Programming and Scripting
Hi All,
I have tried to use ckdate (sun) command in script. It checks the input parameter which should be in 'YYYYMMDD format.
date=$( echo $1 | ckdate -f "%Y%m%d") | true
if ]
then
print " success"
else
print "no success"
fi
But in whatever format i pass the parameter,... (3 Replies)
Discussion started by: Amit.Sagpariya
3 Replies
5. UNIX for Dummies Questions & Answers
Yes, i did... let me state my problem in more detail
Inputs:
I have one input CSV file
And, i have stored no. of comma each line should in a variable.
e.g.
$ cat cmt.csv
this, is a ,comma ,count test1
,,this, is a ,comma ,count test2
this, is a ,comma ,count test3... (6 Replies)
Discussion started by: Dipali
6 Replies
6. Shell Programming and Scripting
Hi all,
I have a shell script(K shell) which takes a date as input.
i want the input to be in DD-MM-YYYY format.
Can i enforce such a format of input string using just one line of code?
OR
do i need to parse the input date into different components and test them using Case statements... (2 Replies)
Discussion started by: rajugp1
2 Replies
7. Shell Programming and Scripting
i have a input file like this
001|rahim|bajaj|20090102
while reading the file i need to check whether the first column is a number
second column is a name
is there any methodology to check for the same
thanks in advance (2 Replies)
Discussion started by: trichyselva
2 Replies
8. Shell Programming and Scripting
Trying to create a script in BASH that would ask the user to enter another user name making sure the input is not blank before they hit enter then to check the home directory of that user does exist, I have the check folder sorted it's just the loop to make sure the user has entered chars (5 Replies)
Discussion started by: MBN
5 Replies
9. Shell Programming and Scripting
I am trying to validate input from the user in a script. I thought is was easy to do using regular expressions but I can't figure out how to use REs in a conditional. I have tried using grep from a temp file, sed from a temp file, sed from command line, comparison in an if condition and I cannot... (1 Reply)
Discussion started by: nrodolfich
1 Replies
10. Programming
how do i validate y script so that it only accepts values between 1 and 3 and against any character input, cause at the moment i can only validate against numbers outside 1 and 3 but not characters
cheers (4 Replies)
Discussion started by: ruffenator
4 Replies