Sponsored Content
Operating Systems AIX Issue with wildcard in filename (AIX 7.1.0.0) Post 303010774 by Don Cragun on Saturday 6th of January 2018 03:45:21 PM
Old 01-06-2018
Quote:
Originally Posted by zulfi123786
I am using ksh and for the variable, I hard coded the value
Code:
yyyymm=20171210

That would be appropriate if the variable had been named yyyymmdd and you had used the filename matching pattern:
Code:
ls -ltr npidata_?????????${yyyymmdd}.csv

instead of:
Code:
ls -ltr npidata_?????????${yyyymm}??.csv

For the filename matching pattern you're using, you needed to set yyyymm using:
Code:
yyyymm=201712

instead of:
Code:
yyyymm=20171210

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Find wildcard .shtml files in wildcard directories and removing them- How's it done?

I'm trying to figure out how to build a small shell script that will find old .shtml files in every /tgp/ directory on the server and delete them if they are older than 10 days... The structure of the paths are like this: /home/domains/www.domain2.com/tgp/ /home/domains/www.domain3.com/tgp/... (1 Reply)
Discussion started by: Neko
1 Replies

2. AIX

AIX Routing Issue

Hello, I've moved to a new network with multiple AIX box's. Most of them are working fine and dandy. On one box I need to set up a static route to a gateway.. no problem right? Whenever I add the route it appears in the routing table as UGc and then begins adding new entries to the... (1 Reply)
Discussion started by: joshstar14
1 Replies

3. AIX

Performance issue in AIX 5.3

Is there is any way to increase the CPU utilization of a Embedded SQL program in AIX 5.3 .. for performance purpose. (0 Replies)
Discussion started by: Gyanendra Awast
0 Replies

4. AIX

Issue "Error 404" when upgrade AIX 5300-05-CSP-0000 to AIX (5300-09-02-0849)

Please read my issue! My old server using: - AIX system operating (5300-05-CSP-0000) - WebSphere 6.1.0.21 (Fix Pack 21) After I've upgraded version AIX - AIX system operating (5300-09-02-0849) - WebSphere 6.1.0.21 (Fix Pack 21) I have 1 issue when I access home page: "Error... (0 Replies)
Discussion started by: gamonhon
0 Replies

5. UNIX for Dummies Questions & Answers

grep pipe filename print issue

uname -a SunOS mypc 5.10 Generic_141414-07 sun4v sparc SUNW,SPARC-Enterprise-T2000 uname -a SunOS mypc 5.10 Generic_144488-07 sun4v sparc SUNW,SPARC-Enterprise-T5220 find . -name "*.cer" -exec keytool -v -list -printcert -file {} \; | grep -i "Aug 03" Valid from: Mon Jan 29 00:00:00 GMT... (16 Replies)
Discussion started by: shifahim
16 Replies

6. AIX

GIT issue in AIX 6.1

Hello, I recently installed GIT 1.8.1 on my AIX 6.1 machine referring to AIX Open Source Packages | Main / git website and am facing a few issues with it. Now if I login as root and issue git commands like git --version I get the response as shown : git version 1.8.1And I have tried creating... (4 Replies)
Discussion started by: gaugeta
4 Replies

7. Emergency UNIX and Linux Support

Waiting for wildcard filename to exists in while loop

Hi Experts, We are developing a script which will wait for the trigger file(with datetime in the trigger file name). But the problem is when I use 'while' loop to wait for the file, it waits for the filename with wilcard in it that is wait for 'Trigger*.done' file. :eek: Below is the script ... (4 Replies)
Discussion started by: Amey Joshi
4 Replies

8. UNIX for Dummies Questions & Answers

Is "stat: illegal option -- -" an issue with hyphenated filename or flag problem?

Hi. I'm trying to install VMWare Workstation to run a virtual machine on my Mac OS, but running the bundle from bash(xterm) sh VMware-workstation-Full-11.0.0-2305329.x86_64.bundle (as suggested in install guide) comes up with error:stat: illegal option -- - usage: stat Digging... (5 Replies)
Discussion started by: defeated
5 Replies

9. Shell Programming and Scripting

Issue when printing filename through cygwin using a variable with awk

Hi, If i were to do this an print out the file, it will show as it is in the command $ awk '/Privilege Use/ {P=0} /Object Access/ {P=1} P' AdvancedAudit.txt Object Access File System No Auditing Registry No Auditing Kernel... (1 Reply)
Discussion started by: alvinoo
1 Replies

10. Shell Programming and Scripting

List filename of files only inside a directory (non-recurrsive) on AIX

I wish to list only files along with the absolute path in a given directory on my AiX 6.1 system. Below is the best I could do. ls -p "/app/scripts"/* This gives a a list of all filename along with folder names with absolute path non-recurrsive (without listing files in sub-directories)... (1 Reply)
Discussion started by: mohtashims
1 Replies
filelib(3erl)						     Erlang Module Definition						     filelib(3erl)

NAME
filelib - File utilities, such as wildcard matching of filenames DESCRIPTION
This module contains utilities on a higher level than the file module. The module supports Unicode file names, so that it will match against regular expressions given in Unicode and that it will find and process raw file names (i.e. files named in a way that does not confirm to the expected encoding). If the VM operates in Unicode file naming mode on a machine with transparent file naming, the fun() provided to fold_files/5 needs to be prepared to handle binary file names. For more information about raw file names, see the file module. DATA TYPES
filename() = string() | atom() | DeepList | RawFilename DeepList = [char() | atom() | DeepList] RawFilename = binary() If VM is in unicode filename mode, string() and char() are allowed to be > 255. RawFilename is a filename not subject to Unicode translation, meaning that it can contain characters not conforming to the Unicode encoding expected from the filesystem (i.e. non-UTF-8 characters although the VM is started in Unicode filename mode). dirname() = filename() EXPORTS
ensure_dir(Name) -> ok | {error, Reason} Types Name = filename() | dirname() Reason = posix() -- see file(3erl) The ensure_dir/1 function ensures that all parent directories for the given file or directory name Name exist, trying to create them if necessary. Returns ok if all parent directories already exist or could be created, or {error, Reason} if some parent directory does not exist and could not be created for some reason. file_size(Filename) -> integer() The file_size function returns the size of the given file. fold_files(Dir, RegExp, Recursive, Fun, AccIn) -> AccOut Types Dir = dirname() RegExp = regular_expression_string() Recursive = true|false Fun = fun(F, AccIn) -> AccOut AccIn = AccOut = term() The fold_files/5 function folds the function Fun over all (regular) files F in the directory Dir that match the regular expression RegExp (see the re module for a description of the allowed regular expressions). If Recursive is true all sub-directories to Dir are processed. The regular expression matching is done on just the filename without the directory part. If Unicode file name translation is in effect and the file system is completely transparent, file names that cannot be interpreted as Unicode may be encountered, in which case the fun() must be prepared to handle raw file names (i.e. binaries). If the regular expression contains codepoints beyond 255, it will not match file names that do not conform to the expected character encoding (i.e. are not encoded in valid UTF-8). For more information about raw file names, see the file module. is_dir(Name) -> true | false Types Name = filename() | dirname() The is_dir/1 function returns true if Name refers to a directory, and false otherwise. is_file(Name) -> true | false Types Name = filename() | dirname() The is_file/1 function returns true if Name refers to a file or a directory, and false otherwise. is_regular(Name) -> true | false Types Name = filename() The is_regular/1 function returns true if Name refers to a file (regular file), and false otherwise. last_modified(Name) -> {{Year,Month,Day},{Hour,Min,Sec}} | 0 Types Name = filename() | dirname() The last_modified/1 function returns the date and time the given file or directory was last modified, or 0 if the file does not exist. wildcard(Wildcard) -> list() Types Wildcard = filename() | dirname() The wildcard/1 function returns a list of all files that match Unix-style wildcard-string Wildcard . The wildcard string looks like an ordinary filename, except that certain "wildcard characters" are interpreted in a special way. The following characters are special: ? : Matches one character. * : Matches any number of characters up to the end of the filename, the next dot, or the next slash. [Character1,Character2,...] : Matches any of the characters listed. Two characters separated by a hyphen will match a range of characters. Example: [A-Z] will match any uppercase letter. {Item,...} : Alternation. Matches one of the alternatives. Other characters represent themselves. Only filenames that have exactly the same character in the same position will match. (Match- ing is case-sensitive; i.e. "a" will not match "A"). Note that multiple "*" characters are allowed (as in Unix wildcards, but opposed to Windows/DOS wildcards). Examples: The following examples assume that the current directory is the top of an Erlang/OTP installation. To find all .beam files in all applications, the following line can be used: filelib:wildcard("lib/*/ebin/*.beam"). To find either .erl or .hrl in all applications src directories, the following filelib:wildcard("lib/*/src/*.?rl") or the following line filelib:wildcard("lib/*/src/*.{erl,hrl}") can be used. To find all .hrl files in either src or include directories, use: filelib:wildcard("lib/*/{src,include}/*.hrl"). To find all .erl or .hrl files in either src or include directories, use: filelib:wildcard("lib/*/{src,include}/*.{erl,hrl}") wildcard(Wildcard, Cwd) -> list() Types Wildcard = filename() | dirname() Cwd = dirname() The wildcard/2 function works like wildcard/1 , except that instead of the actual working directory, Cwd will be used. Ericsson AB stdlib 1.17.3 filelib(3erl)
All times are GMT -4. The time now is 12:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy