Sponsored Content
Top Forums Shell Programming and Scripting To verify whether the year has all the digits Post 302329136 by rak007 on Friday 26th of June 2009 05:23:37 AM
Old 06-26-2009
^ Thanks a million Buddy...its working

Just one more question, if i repace the original IF condition with this revised one then still the meaning of the whole thing remains same right ?

---------- Post updated at 02:42 AM ---------- Previous update was at 02:26 AM ----------

Guys the earlier problem is rectified but a new one has come now

Here s the offending code

Code:
if [[ $myline = [a-zA-Z0-9]*_ACCRUAL_@([0-9])@([0-9])@([0-9])@([0-9])@([0-9])@([0-9])@([0-9])@([0-9]).csv ]]

Here the variable myline contains some file name and i suppose that is being checked for format and all. :0

---------- Post updated at 04:23 AM ---------- Previous update was at 02:42 AM ----------

The above code unit is giving me following errors

Code:
syntax error in conditional expression: unexpected token `('
syntax error near `[a-zA-Z0-9]*_ACCRUAL_@(['

 

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
CAL(1)							    BSD General Commands Manual 						    CAL(1)

NAME
cal -- displays a calendar SYNOPSIS
cal [-smjy13] [[[day] month] year] DESCRIPTION
Cal displays a simple calendar. If arguments are not specified, the current month is displayed. The options are as follows: -1 Display single month output. (This is the default.) -3 Display prev/current/next month output. -s Display Sunday as the first day of the week. -m Display Monday as the first day of the week. -j Display Julian dates (days one-based, numbered from January 1). -y Display a calendar for the current year. -V Display version information and exit. A single parameter specifies the year (1 - 9999) to be displayed; note the year must be fully specified: ``cal 89'' will not display a calen- dar for 1989. Two parameters denote the month (1 - 12) and year. Three parameters denote the day (1-31), month and year, and the day will be highlighted if the calendar is displayed on a terminal. If no parameters are specified, the current month's calendar is displayed. A year starts on Jan 1. The first day of the week is determined by the locale. The Gregorian Reformation is assumed to have occurred in 1752 on the 3rd of September. By this time, most countries had recognized the ref- ormation (although a few did not recognize it until the early 1900's.) Ten days following that date were eliminated by the reformation, so the calendar for that month is a bit unusual. HISTORY
A cal command appeared in Version 6 AT&T UNIX. OTHER VERSIONS
Several much more elaborate versions of this program exist, with support for colors, holidays, birthdays, reminders and appointments, etc. For example, try the cal from http://home.sprynet.com/~cbagwell/projects.html or GNU gcal. AVAILABILITY
The cal command is part of the util-linux-ng package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/. BSD
June 6, 1993 BSD
All times are GMT -4. The time now is 01:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy