Sponsored Content
Top Forums Shell Programming and Scripting To verify whether the year has all the digits Post 302329131 by rak007 on Friday 26th of June 2009 03:04:39 AM
Old 06-26-2009
^^
This is what i did
Code:
year='2009'
echo year is $year
if [[ ! -z `echo $year | tr -d '[0-9]'` ]]
then
echo 'year in error'
fi
echo end of program

But i got this error

Code:
t1.sh: [[: not found

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Verify Parameters

I have a unix script written in the korn shell. At the top of the script I call a script that exports the values of the variables I use in my script. I know that when you execute the script using ksh -x it shows you the script running. I was wondering if there was a way you could run the script... (2 Replies)
Discussion started by: lesstjm
2 Replies

2. Shell Programming and Scripting

verify arguments

thanks for your help, im gonna skip this one and try a different question. thanks for your help though. (2 Replies)
Discussion started by: bebop1111116
2 Replies

3. Shell Programming and Scripting

total last digits

hi group, How can I count total number of 5's which are continuous in the end. i.e. in the below string, the o/p should be 4 I just know to calculate total number of 5's $ echo "95952325555" | awk -F "5" '{print NF-1}' 6 (3 Replies)
Discussion started by: uwork72
3 Replies

4. Shell Programming and Scripting

help: single digits inflated to 2 digits

Hi Folks Probably an easy one here but how do I get a sequence to get used as mentioned. For example in the following I want to automatically create files that have a 2 digit number at the end of their names: m@pyhead:~$ for x in $(seq 00 10); do touch file_$x; done m@pyhead:~$ ls file*... (2 Replies)
Discussion started by: amadain
2 Replies

5. Shell Programming and Scripting

Verify the input

I run the script with one parameter : myscript abc002 But I need my script to check the parameter in txt array first: txt="abc001 abc002 abc004" What's the best way to do it? I am using ksh. #! /usr/bin/ksh txt="abc001 abc002 abc004" if ; then echo " Your input is wrong,... (9 Replies)
Discussion started by: newoz
9 Replies

6. AIX

verify command

Guy's I have script doing many steps as the below ... ############# ## step1# mount all Files system mount all ## step2# Start the application /app/appsh ############# but some time mount points will not be mounted completely so that will give an error if the next step started... (1 Reply)
Discussion started by: Mr.AIX
1 Replies

7. Shell Programming and Scripting

Find filenames with three digits and add zeros to make five digits

Hello all! I've looked all over the internet and this site and have come up a loss with an easy way to make a bash script to do what I want to do. I have a file with a naming convention as follows: 2012-01-18 string of words here 123.jpg 2012-01-18 string of words here 1234.jpg 2012-01-18... (2 Replies)
Discussion started by: Buzzman25
2 Replies

8. Hardware

Verify patching

I patched a linux kernel 2.6.28 with lttng patch. Now I have two folder of linux patched and unpatched. How can I verify whether the linux is patched or unptahced(original version)? (0 Replies)
Discussion started by: rupeshkp728
0 Replies

9. Red Hat

Verify multipathing

I have a couple of questions regarding multipath. If I do vgdisplay vg01, I see it is using 1 PV: /dev/dm-13 If I type multipath -ll I see dm-9, dm-10, dm-11, dm-12, but do not see dm-13. Is my vg01 multipathed? How can I actually know for sure? Secondly, let's say this time vg01 says... (1 Reply)
Discussion started by: keelba
1 Replies

10. UNIX for Beginners Questions & Answers

sed / awk script to delete the two digits from first 3 digits

Hi All , I am having an input file as stated below 5728 U_TOP_LOGIC/U_CM0P/core/u_cortexm0plus/u_top/u_sys/u_core/r03_q_reg_20_/Q 011 611 U_TOP_LOGIC/U_CM0P/core/u_cortexm0plus/u_top/u_sys/u_core/r04_q_reg_20_/Q 011 3486... (4 Replies)
Discussion started by: kshitij
4 Replies
hdate_struct(3) 						libhdate C language						   hdate_struct(3)

NAME
hdate_struct - libhdate Hebrew date struct SYNOPSIS
#include <hdate.h> Data Fields int hd_day int hd_mon int hd_year int gd_day int gd_mon int gd_year int hd_dw int hd_size_of_year int hd_new_year_dw int hd_year_type int hd_jd int hd_days int hd_weeks Detailed Description libhdate Hebrew date struct Field Documentation int hdate_struct::hd_day The number of day in the hebrew month (1..31). int hdate_struct::hd_mon The number of the hebrew month 1..14 (1 - tishre, 13 - adar 1, 14 - adar 2). int hdate_struct::hd_year The number of the hebrew year. int hdate_struct::gd_day The number of the day in the month. (1..31) int hdate_struct::gd_mon The number of the month 1..12 (1 - jan). int hdate_struct::gd_year The number of the year. int hdate_struct::hd_dw The day of the week 1..7 (1 - sunday). int hdate_struct::hd_size_of_year The length of the year in days. int hdate_struct::hd_new_year_dw The week day of Hebrew new year. int hdate_struct::hd_year_type The number type of year. int hdate_struct::hd_jd The Julian day number int hdate_struct::hd_days The number of days passed since 1 tishrey int hdate_struct::hd_weeks The number of weeks passed since 1 tishrey Author Generated automatically by Doxygen for libhdate C language from the source code. Version 1.4 Sun Jan 8 2012 hdate_struct(3)
All times are GMT -4. The time now is 02:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy