Search Results

Search: Posts Made By: harry0013
2,169
Posted By harry0013
The output i get is this. > findlog.sh 05/05/09...
The output i get is this.
> findlog.sh 05/05/09
Invalid date format
2,169
Posted By harry0013
Is this valid.. if [ $mydate =...
Is this valid..

if [ $mydate = @(0[1-9]|1[0-2])/@(0[1-9]|[12][0-9]|3[01])/[0-9][0-9] ]; then
exit 0
else
echo "Invalid date format"
exit 0
fi
10,509
Posted By harry0013
Thanks all. I appreciate your help.
Thanks all. I appreciate your help.
2,169
Posted By harry0013
date format
hi,

just want to validate date input in an argument if correct with the format mm/dd/yy. no need to check if input date is within range or not. what i need is to check only if it is on 'mm/dd/yy'...
10,509
Posted By harry0013
Validate date format in argument
Hi..

I'm a newbie in KSH. Need help. How can I validate input date format in argument using format mm/dd/yy. Eg. > findlog.sh 12/30/09. Any info/help is highly appreciated.
10,570
Posted By harry0013
Thank you all. Its working now using -s option.
Thank you all. Its working now using -s option.
10,570
Posted By harry0013
syntax for CAT in ksh
Just want to ask if the below code is correct;

if [ {cat out.txt |wc -l} -eq 0 ]; then
echo "No log found from " $data
exit 0
else
cat out.txt
fi

this is to test if the content of...
9,596
Posted By harry0013
ei..its working great! thank you so much.
ei..its working great! thank you so much.
9,596
Posted By harry0013
The 1 or 2 digits is ok but when the 3 digit is...
The 1 or 2 digits is ok but when the 3 digit is used which is the correct argument, it is showing wrong number. eg 035 should also result in 035. Thank you.
9,596
Posted By harry0013
I tried to test the below code but it is showing...
I tried to test the below code but it is showing me odd results

data=`printf "%03d" $1`
echo $data

Sample test:
> findlog.sh 001
001
> findlog.sh 020
016
> findlog.sh 035
029
>...
9,596
Posted By harry0013
Sorry..'find' is just a sample, the actual name...
Sorry..'find' is just a sample, the actual name is 'findlog'.
Is printf works in ksh? I'm just a newbie. Thank you.
9,596
Posted By harry0013
Formatting digits
I want to check the argument in KSH. If the user type in the prompt 'find 3' it will format 3 to 003 to match the data in the text file. Same as with 10 to 010. Always begins with 0.

eg.
...
Showing results 1 to 12 of 12

 
All times are GMT -4. The time now is 09:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy