Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Best way to increment weeks based on fiscal start year Post 303006486 by RudiC on Thursday 2nd of November 2017 02:10:45 PM
Old 11-02-2017
Well, I'm confused, according to unix.com's man ksh , ksh93(1)
has
Quote:
${parameter/pattern/string}
${parameter//pattern/string}
.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How many weeks in a year

Hi, I search how i could do to find if a year (for example 2004, 1989, 2058) has 52 or 53 weeks... Have you a idea for me please??? (1 Reply)
Discussion started by: Castelior
1 Replies

2. Solaris

Number of files - in start of year

Is there any way to find "Number of files" that exists on my solaris parition in the starting of 2009 year ? I know ctime or mtime will not help and unix wouldnt store creation time. Only hope i can see ( and i am not sure if that will help ) is that my system is up from last 2 years without... (5 Replies)
Discussion started by: rajwinder
5 Replies

3. Shell Programming and Scripting

how to increment days according to year & month

Hiii i have a file with data as shown below: a.dat: RAO 1900 2 7 0 0 0.00 10.8000 76.8000 10.0 0 0.00 0 6.00 0.00 0.00 0 0.00 6.00 0 NULL LEE 1901 2 15 0 0 0.00 26.0000 100.0000 0.0 0 0.00 0 0.00 0.00 0.00 0 6.00 6.00 0 NULL RAO 1901 4... (3 Replies)
Discussion started by: reva
3 Replies

4. Shell Programming and Scripting

My PM has told me to learn shell scripting in 2 weeks , how should I start?

My PM has told me to learn shell scrting in 2 weeks , how should I start?:confused::confused::confused::confused: (1 Reply)
Discussion started by: manalisharmabe
1 Replies

5. Shell Programming and Scripting

Value Increment based on count

Hi All, I have source file x.txt 0001|0003 0031|0031 0045|0049 My desired output should be: y.txt 0001 0002 0003 0031 0045 0046 0047 (11 Replies)
Discussion started by: kmsekhar
11 Replies

6. Shell Programming and Scripting

How to calculate the total number of weeks from a specify year?

Hi anyone can help? How to calculate total number of weeks from a specify date, for example, 01 Jan 2012. Thx! (2 Replies)
Discussion started by: rayray2013
2 Replies

7. Shell Programming and Scripting

Create new file with increment column based on conditions

Hello, Using bash script, i need to process the following file: 887,86,,2013-11-06,1,10030,5,2,0,200,, 887,86,,2013-11-05,1,10030,5,2,0,199,, 887,138,,2013-11-06,1,10031,6,2,0,1610612736,, 887,164,,2013-11-06,1,10000,0,2,0,36000,, and to create a new file such as the below ... (2 Replies)
Discussion started by: JonhyDeep
2 Replies

8. Shell Programming and Scripting

Increment with awk - how to define start value

Hello, I am running under ubuntu18.04 My question is about awk. inputfile 0wo010011oasasds sdjhsdjh=, u12812888 8jsjkahsjajnsanakn akjskjskj=, suhuhuhwx kskkxmsnnxsnjxsnjxsnjjnjjdi=, 22878ssssss Below code adds consecutive numbers when string = is found run_code: awk -F'=' -v OFS='='... (4 Replies)
Discussion started by: baris35
4 Replies

9. Web Development

Color a Badge Based on the Weeks the Member is Active in the Latest Sequence

Hi Ravinder, Could you (and anyone else who wants to help out) check this PHP code and confirm it does what I expect it to do, which is to color a badge based on the weeks a member is active in the latest sequence? I did a cut-paste-change from my "days in sequence" PHP prototype script and it... (6 Replies)
Discussion started by: Neo
6 Replies

10. UNIX for Beginners Questions & Answers

Splitting week start date and end date based on custom period start dates

Below are my custom period start and end dates based on a calender, these dates are placed in a file, for each period i need to split into three weeks for each period row, example is given below. Could you please help out to achieve solution through shell script.. File content: ... (2 Replies)
Discussion started by: nani2019
2 Replies
fnmatch(3)						     Library Functions Manual							fnmatch(3)

NAME
fnmatch - Matches filename patterns LIBRARY
Standard C Library (libc.so, libc.a) SYNOPSIS
#include <fnmatch.h> int fnmatch( const char *pattern, const char *string, int flags); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: fnmatch(): XPG4, XPG4-UNIX Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Contains the pattern to which the string parameter is to be compared. Contains the string to be compared against the pattern parameter. Contains a bit flag specifying the configurable attributes of the comparison to be performed by the fnmatch function. The flags parameter modifies the interpretation of the pattern and string parameters. It is the bitwise inclusive OR (|) of 0 (zero) or more of the following flags, which are defined in the fnmatch.h file. Slash in the string parameter only matches slash in the pattern parameter. Leading period in the string parameter must be exactly matched by period in the pattern parameter. Unless FNM_NOESCAPE is set, preceding a character in pattern with a (backslash character) causes fnmatch() to match that character in string. For example, \ matches a backslash in string. If FNM_NOESCAPE is set, (backslash) is interpreted as an ordinary character. If the FNM_PATHNAME flag is set in the flags parameter, a / (slash) in the string parameter is explicitly matched by a / in the pattern parameter. It is not matched by either the * (asterisk) or ? (question-mark) special characters, nor by a bracket expression. If the FNM_PATHNAME flag is not set, the / is treated as an ordinary character. If FNM_PERIOD is set in the flags parameter, then a leading period in the string parameter only matches a period in the pattern parameter; it is not matched by either the asterisk or question-mark special characters, nor by a bracket expression. A period is determined to be leading according to the setting of the FNM_PATHNAME flag, according to the following rules: If the FNM_PATHNAME flag is set, a period is leading only if it is the first character in the string parameter or if it immediately follows a slash. If the FNM_PATHNAME flag is not set, a period is leading only if it is the first character of the string parameter. If FNM_PERIOD is not set, no special restrictions are placed on matching a period. A (backslash character) quotes the next character, unless FNM_NOESCAPE is set. If FNM_NOESCAPE is set, (backslash) is treated as itself. DESCRIPTION
The fnmatch() function checks the string specified by the string parameter to see if it matches the pattern specified by the pattern param- eter. This routine follows the match criteria of the glob() function. The fnmatch function is useful when a program needs to perform pattern matching, such as when a directory is to be searched for a particu- lar string (as is the case with the find command). A program like the pax command can also use the fnmatch() function to perform its pat- tern matching operations. RETURN VALUES
If the value in the string parameter matches the pattern specified by the pattern parameter, then the fnmatch() function returns 0 (zero). If there is no match, the fnmatch() function returns FNM_NOMATCH, which is defined in the fnmatch.h file. If an error occurs, the fnmatch() function returns a nonzero value. RELATED INFORMATION
Functions: glob(3), globfree(3), regcomp(3) Standards: standards(5) delim off fnmatch(3)
All times are GMT -4. The time now is 04:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy