05-21-2010
Last edited by pseudocoder; 05-21-2010 at 11:52 AM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have written a shell script and in my script i have a variable
filename=myfile.txt
now, i want another variable to be defined for which i have to strip out the extension fo the file name,
i.e. newvariable= myfile
how do i strip out the ".txt" part from my first variable.
Any kind of help... (4 Replies)
Discussion started by: ramky79
4 Replies
2. Shell Programming and Scripting
This command gives me just the filename without any extension:
evrvar =`echo filename.tar | sed 's/\.*$//'`
I am trying to make a change to this command... to make it work for... filename.tar.gz to get just the filename....
currently the command gives me filename.tar by removing only gz... I... (9 Replies)
Discussion started by: devs
9 Replies
3. Shell Programming and Scripting
hi all,
i'm new to shell scripting, i need help from u guys to do my task now..
i just need to check a file extension existence in a directory, and if it exists then i have to continue my processing.
pls give me the command to check the extension of the files (6 Replies)
Discussion started by: divak
6 Replies
4. UNIX for Dummies Questions & Answers
unix program to which a directory name will be passed as
parameter. This directory will contain files with various
extensions. This script will create directories with the names of the
extention of the files and then put the files in the
corresponding folder. All files which do not have any... (2 Replies)
Discussion started by: Deekay.p
2 Replies
5. Shell Programming and Scripting
I have a file
n06-z30-sr65-rgdt0p25-varp0.25-8x6drw-test.cmod
and I want to get the extension.
At the moment I have
set filextension = `echo $f | awk 'BEGIN {FS="."} {print $2}'`
which of course does not work as there is a point in varp0.25 (13 Replies)
Discussion started by: kristinu
13 Replies
6. Shell Programming and Scripting
Hi Friends,
I am using the following command
for i in `ls $PWD`; do cat $i > test && mv test $i; done
But, I want to execute another command and write the output to another file with different extension but same name, like this
I tried using this
for i in `ls $PWD`; do... (2 Replies)
Discussion started by: jacobs.smith
2 Replies
7. Shell Programming and Scripting
I have a list file that contains names of many files. I am reading one file name at a time using for loop
Then I like to create one more list file but with the file extension changed to "ctl".
Note: The file name can have any number of dots ".". But the extension after the last dot should be... (4 Replies)
Discussion started by: pinnacle
4 Replies
8. UNIX for Dummies Questions & Answers
Hi All,
I want to fetch the files based on .done file and display the .csv files and Wil take .csv files for processing.
1.I need to display the .done files from the directory.
2.next i need to search for the .Csv files based on .done file.then move .csv files for the one directory
... (2 Replies)
Discussion started by: girija.g6
2 Replies
9. UNIX for Dummies Questions & Answers
I'm afraid this is a silly question but I can't figure it out.
I have a script like so...
echo "Enter DRDL Signature Version Number"
read DRDL_Number
mv signature_output.csv SERVICE_OBJECTS_S-$DRDL_Number.csv
The resultant filename does not contain the .csv as follows.... (3 Replies)
Discussion started by: Cludgie
3 Replies
10. Shell Programming and Scripting
I have a specific set (all ending with .bam) of downloaded files in a directory /home/cmccabe/Desktop/NGS/API/2-15-2016. What I am trying to do is use a match to $2 in name to rename the downloaded files. To make things a more involved the date of the folder is unique and in the header of name... (1 Reply)
Discussion started by: cmccabe
1 Replies
LEARN ABOUT DEBIAN
mbkfopen
MBKFOPEN(3) MBK UTILITY FUNCTIONS MBKFOPEN(3)
NAME
mbkfopen - open a file with several search pathes
ORIGIN
This software belongs to the ALLIANCE CAD SYSTEM developed by the ASIM team at LIP6 laboratory of Universite Pierre et Marie CURIE, in
Paris, France.
Web : http://asim.lip6.fr/recherche/alliance/
E-mail : alliance-users@asim.lip6.fr
SYNOPSYS
#include "mut.h"
FILE *mbkfopen(name, extension, mode)
char *name, *extension, *mode;
PARAMETERS
name Name of the file to be opened
extension Extension to the file name
model File opening mode
DESCRIPTION
mbkfopen opens a file, searching it through the pathes given in the environment variables MBK_CATA_LIB(1) and MBK_WORK_LIB(1). Its main
issue is to enable simple file access for any program that works with mbk path environment variables.
The file to be opened is called name.extension, if extension is not NULL, else it is name. If extension is the empty string, "", then the
file name will be name. .
The legal values for mode are
READ_TEXT opens for reading
WRITE_TEXT discards and opens for writting
since disk access should be a straight forward operation knowing mbk's needs.
The search algorithm depends on the value of mode. If mode is WRITE_TEXT, then the file is open for writting in MBK_WORK_LIB(1). If mode
is READ_TEXT then the file is first searched through MBK_WORK_LIB(1), and if not found, through each directory specified in
MBK_CATA_LIB(1), in the order of declaration under unix. No internal hash table is generated, in order to let the user choose its direc-
tory priority. As soon as the file is found, it is opened. There is no check for redundant files in the specified pathes, since it is
neither illegal nor bad to have many files with the same names.
RETURN VALUE
mbkfopen returns a pointer to the opened file. If the file read or write access are violated, or the file not found, a NULL pointer is
returned.
ERROR
"*** mbk error *** mbkfopen : unknown file opening mode mode"
The mode parameter is not one of the two legal values.
EXAMPLE
#include "mut.h"
#include "mph.h"
phfig_list *load_vti_ph(name)
char *name;
{
FILE *file;
if ((file = mbkfopen(name, "cp", READ_TEXT)) == NULL) {
(void)fprintf(stderr, "Pfhhh, can't open name.cp
");
EXIT();
}
ph_parse(file);
}
SEE ALSO
mbk(1), MBK_CATA_LIB(1), MBK_WORK_LIB(1), loadlofig(3), loadphfig(3), savelofig(3), savephfig(3), fopen(3).
BUG REPORT
This tool is under development at the ASIM department of the LIP6 laboratory.
We need your feedback to improve documentation and tools.
ASIM
/LIP6 October 1, 1997 MBKFOPEN(3)