Hi,
I am writing a BASH script. I have a list of files and I would like to make sure that each is of a specific pattern (ie *.L2). If not I would like to remove that file. How do I test whether a filename matches a given pattern?
Thanks a lot.
Mike (10 Replies)
Hi All,
I'm new to unix shell scripting.. Could someone guide me.
I have to search a string in the entire directory, once the search string is matched, it should print the line number of the string that matches and also the line and along with
it, it should print the file name.
Thanks,... (5 Replies)
Hi,
Lets say I have a few xml files:
1234567894.xml
abc_1234567895.xml
abc_000_1234567890.xml
abc_0000000_1234567893.xml
684_abc_000_1234567899.xml
The naming convention of the files is:
xxxxx_timestamp.xml OR timestamp.xml
where x can be anything
and I would like to order them by... (4 Replies)
Hi All,
I posted something similar before but I now have a another problem.
I have filenames as below
TOP_TABIN240_20090323.200903231830
TOP_TABIN235_1_20090323.200903231830
i need to extract the dates as in bold. Using bash v 3.xx
Im trying to using the print sed command but... (11 Replies)
Hi
I would like to extract the first portion of filename from a list of files.
The filename pattern is of the form 123456789_TEXT_TEXT_TEXT_.csv. I want to extract just the numerical portion of this filename from the list of files and then output this into another text file.
K (6 Replies)
Hello All,
I have two issues.
1).I want to check if directory exists and inside that if file exists with today's date minus one. I can check directory exists but how can i check only a pattern of filename in that directory.Name of file is files-20170105-09.gz.
2).Also i want to exit immediately... (6 Replies)
In the below bash I am trying to rename eachof the 3 text files in /home/cmccabe/Desktop/percent by matching the numerical portion of each file to lines 3,4, or 5 in /home/cmccabe/Desktop/analysis.txt. There will always be a match between the files. When a match is found each text file in... (2 Replies)
In the portion of bash below I am using rename to match the $id variable to $file and when a match (there will alwsys be one) is found then the $id is removed from each bam and bam.bai in $file and _test is added to thee file name before the extension. Each of the variables is set correctly but... (3 Replies)
Discussion started by: cmccabe
3 Replies
LEARN ABOUT SUSE
get_filename
get_filename(3alleg4) Allegro manual get_filename(3alleg4)NAME
get_filename - Returns a pointer to the filename portion of a path. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
char *get_filename(const char *path);
DESCRIPTION
Finds out the filename portion of a completely specified file path. Both `' and `/' are recognized as directory separators under DOS and
Windows. However, only `/' is recognized as directory separator under other platforms. Example:
get_executable_name(name, sizeof(name));
allegro_message("Running `%s'
", get_filename(name));
Note that Allegro won't perform any IO operations during the verification. This means that if you have `/a/path/like/this/', which doesn't
have a filename, the function will return a pointer to the trailing null character. However, if you have `/a/path/like/this', Allegro will
return a pointer to `this', even if it is a valid directory.
RETURN VALUE
Returns a pointer to the portion of `path' where the filename starts, or the beginning of `path' if no valid filename is found (eg. you are
processing a path with backslashes under Unix).
SEE ALSO get_extension(3alleg4), put_backslash(3alleg4), replace_filename(3alleg4), exmidi(3alleg4)Allegro version 4.4.2 get_filename(3alleg4)