Sponsored Content
Top Forums Shell Programming and Scripting Removal of file extension question Post 302506952 by markdjones82 on Tuesday 22nd of March 2011 10:49:27 AM
Old 03-22-2011
Removal of file extension question

All,
I know that this will remove a file extension from a file name, but reading on the documentation on how it works confuses me.
Code:
${filename%.*}

Can anyone explain what exactly is going on here? Filename is the pattern and % says to cut anything that starts with .?

Also, can I run this command and then insert a timestamp in between the filename and the extension? I am hoping to do something like mv $filename ${filename%.*}`date`.txt. Can this be done without a for loop for each file with the exec command?
Code:
find $DESTLOC -maxdepth 1 -type f -exec mv -f {} $ARCHLOC/


Last edited by markdjones82; 03-22-2011 at 12:22 PM..
 

10 More Discussions You Might Find Interesting

1. Solaris

UNIX File removal without conformation

I need to remove permanently some 3 GB of temp folder which contains Log file, simulation files from my disk. if i use "rm - rf <filename>" command it asks about conformation for accessing each folder and for removing every file and giving yes to every message in terminal window is very... (2 Replies)
Discussion started by: rajharvijay
2 Replies

2. UNIX for Dummies Questions & Answers

Job Watcher Removal Question

All- What is the command to remove/delete a job watcher from production. Thanks, Sailor58 (2 Replies)
Discussion started by: Sailor58
2 Replies

3. Shell Programming and Scripting

Removal of Duplicate Entries from the file

I have a file which consists of 1000 entries. Out of 1000 entries i have 500 Duplicate Entires. I want to remove the first Duplicate Entry (i,e entire Line) in the File. The example of the File is shown below: 8244100010143276|MARISOL CARO||MORALES|HSD768|CARR 430 KM 1.7 ... (1 Reply)
Discussion started by: ravi_rn
1 Replies

4. Shell Programming and Scripting

Removal of carriage returns from a comma delimited file

Hi, I have a file which is having some carriage return in one of the field for which single line is coming in multiple lines. I want to combine all those multiple lines of that field into one line. Eg: Input: Id, Name, Location, Comments, Dept 2, John, US, I am from US. I... (5 Replies)
Discussion started by: mahish20
5 Replies

5. Shell Programming and Scripting

Help with removal of blank spaces in a file

Hello.. I have a text file. I want to remove all the blank spaces(except tab) from the file.. I tried using sed command as shown below sed 's/ //g' file1 But the problem with the above command is that it also eliminates 'tab' which is between the columns.. For example if the contents... (7 Replies)
Discussion started by: abk07
7 Replies

6. Shell Programming and Scripting

Help with removal of numericals in a file

I have a file from which I want to eliminate the numerical values.. The contents of the file are as shown below.. 1 a1,b,2 1,b,c 2 a2,4,b a,b,2 From the above file I want eliminate only the numberical values(except the line numbers which are at the beginning).. The file... (12 Replies)
Discussion started by: abk07
12 Replies

7. Shell Programming and Scripting

Removal of HTML ASCII Codes from file

Hi all, I have a file with extended ASCII codes in the description which needs to be removed. List of extended ascii codes "Œ", "œ", "Š", "š", "Ÿ", "ƒ", "-", "-", "‘", "'", "‚", "“", "”", "„","†", "‡", "•", "...", "‰", "€", "™" Sample data: Test Details-HAVE BEEN PUBLISHED... (1 Reply)
Discussion started by: btt3165
1 Replies

8. Solaris

Removal of zip file permanently

Hi Everyone, I see some peculier thing happening on my server. I have one zipped file created long back as a normal user and trying to remove it now. When i tried to remove as that particular user, i was not able to do that. So i logged in as a root user and removed that successfully. But it... (8 Replies)
Discussion started by: Sricharan21
8 Replies

9. Shell Programming and Scripting

String removal from file

Dear all From below mention input file I needed op file as show below. I am using below code but not worked. I/p file BSCBCH1 EXAL-1-4 WO* SMPS MAINS FAIL BSCBCH1 EXAL-1-5 WO* SMPS RECTIFIER FAIL BSCBCH1 EXAL-1-6 WO* SMPS MAJOR ALARM BSCBCH2 EXAL-1-10 WO* ... (5 Replies)
Discussion started by: jaydeep_sadaria
5 Replies

10. UNIX for Dummies Questions & Answers

Display the .csv extension files based on .done extension fine

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
CHICKEN-INSTALL(1)					      General Commands Manual						CHICKEN-INSTALL(1)

NAME
chicken-install - download and install extension libraries for Chicken Scheme SYNOPSIS
chicken-install [OPTION | EXTENSION[:VERSION]] ... DESCRIPTION
chicken-install is a program that downloads, compiles and installs a prepackaged extension library from sources. If no extension name is given on the command-line, then any existing setup scripts in the current directory will be executed in some unspecified order. OPTIONS
Enter chicken-install -help for a list of supported command-line options. ENVIRONMENT VARIABLES
CHICKEN_PREFIX The installation prefix where CHICKEN Scheme and its support files and libraries are located. Defaults to the installation time pre- fix given when configuring the system. CHICKEN_INSTALL_PREFIX An alternative installation prefix that will be prepended to extension installation paths if specified. CHICKEN_REPOSITORY The path where extension libraries are installed. Defaults to the package-library path selected during configuration (usually /var/lib/chicken/<binary-version> ) DOCUMENTATION
More information can be found in the Chicken User's Manual BUGS
Submit bug reports by e-mail to chicken-janitors@nongnu.org , preferrably using the chicken-bug tool. AUTHORS
The CHICKEN Team SEE ALSO
chicken-uninstall(1) chicken-status(1) chicken(1) csc(1) chicken-bug(1) 13 Aug 2008 CHICKEN-INSTALL(1)
All times are GMT -4. The time now is 03:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy