Sponsored Content
Full Discussion: Script for renaming files
Top Forums Shell Programming and Scripting Script for renaming files Post 302462330 by frans on Thursday 14th of October 2010 01:46:45 AM
Old 10-14-2010
Code:
for F in *; do cp "$F" "${F}.ORIG"; done

To exlude already backuped files:
Code:
for F in *; do [ "${F##*.}" != "ORIG" ] && cp "$F" "${F}.ORIG"; done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Renaming files in a bash script

I'm doing a short batch script to compile po files producing output binary mo files. The compilation command is: msgfmt -o file.mo file.po so in order to compile I am appending .mo to the varible in a loop. It goes something like this: for i in `find . -name "*.po"` do echo... (2 Replies)
Discussion started by: Breen
2 Replies

2. Shell Programming and Scripting

copying files and Renaming them + shell script

Hi, I have a problem. I have some text files in a folder. The names can be like: emp.txt emp1.txt emp3.txt 32emp4.txt What i need is i have to copy all the files which have "emp" string in their filename to a different folder and those file names... (7 Replies)
Discussion started by: pathanjalireddy
7 Replies

3. UNIX for Dummies Questions & Answers

Renaming Files using Shell Script

Hi Gurus, I have some files(all ending with .out as extension). Ex: aa1.out aa2.out aa3.out I would like to append each file with the current date to the end of the file so that they should become aa1_20090504.out. So I am using rename as follows: for i in path/aa* ; do mv $i... (5 Replies)
Discussion started by: asmfloyd
5 Replies

4. Shell Programming and Scripting

Need help with shell script for moving/deleting/renaming files

Hi. I need help with a little script that will be used to move some files to their parent directory, delete the directory, rename one file in the parent directory and delete another, then continue to the next. Here's an example: /var/media/Music/Genesis/1970 album - Trespass (2008 Box -... (4 Replies)
Discussion started by: aflower
4 Replies

5. Shell Programming and Scripting

script for renaming a batch of files

hi i have a folder full of files. some of the names are quite off because the dimensions were the same and i had to put a 'b' after the initial number so that it didnt overwrite. what i want is a script in unix to overwrite the filwe name leaving some of the title intact, e.g. below are some... (3 Replies)
Discussion started by: shabs1985
3 Replies

6. Shell Programming and Scripting

perl thread script for renaming files

i need a threaded perl script, each thread browsing the same directory but renaming different files. Thread A renames file “aaa” to “xxx”, Thread B renames file “bbb” to “yyy” Thread C renames file "ccc" to "zzz" ..... etc (2 Replies)
Discussion started by: anand121
2 Replies

7. Shell Programming and Scripting

Renaming multiple files with a shell script

Hey guys, I'm really new to UNIX and shell scripting in general. For my internship I need to rename a bunch of files. Specifically, I need to change the first letter of each of the files to lowercase and I have to change the endings so they all basically look like "file_cone.jpg". I know I... (4 Replies)
Discussion started by: jjzieve
4 Replies

8. Shell Programming and Scripting

Need script for renaming and moving files one by one...

Dears, I need your help! I got a problem and found some workaround solution but I donno how to realize it. I have a number of files (about 300 each day) and I need them to be renamed. All these files has fixed number of letters and name looks like this one:... (7 Replies)
Discussion started by: nypreH
7 Replies

9. Shell Programming and Scripting

bulk renaming of files in sftp using script

Hi, Am using sftp (dsa method) to transfer 20 files from one server(sftp) to another (local). After the transfer is complete the files in the sftp server has to be renamed from .txt extension to .done extension ( aa.txt to aa.done, bb.txt to bb.done and likewise...). I tried rename command... (4 Replies)
Discussion started by: Sindhuap
4 Replies

10. Shell Programming and Scripting

Renaming multiple files in sftp server in a get files script

Hi, In sftp script to get files, I have to rename all the files which I am picking. Rename command does not work here. Is there any way to do this? I am using #!/bin/ksh For eg: sftp user@host <<EOF cd /path get *.txt rename *.txt *.txt.done ... (7 Replies)
Discussion started by: jhilmil
7 Replies
XMLCATALOG(1)															     XMLCATALOG(1)

NAME
xmlcatalog - Command line tool to parse and manipulate XML or SGML catalog files. SYNOPSIS
xmlcatalog [--sgml --shell --create --del VALUE(S) [ --add TYPE ORIG REPLACE --add FILENAME] --noout --no-super-update [-v --verbose]] {CATALOGFILE} {ENTITIES...} DESCRIPTION
xmlcatalog is a command line application allowing users to monitor and manipulate XML and SGML catalogs. It is included in libxml(3). Its functions can be invoked from a single command from the command line, or it can perform multiple functions in interactive mode. It can operate on both XML and SGML files. OPTIONS
xmlcatalog accepts the following options (in alphabetical order): --add TYPE ORIG REPLACE Add an entry to CATALOGFILE. TYPE indicates the type of entry. Possible types are: public, system, rewriteSystem, rewriteURI, delegatePublic, delegateSystem, nextCatalog. ORIG is the original reference to be replaced, and REPLACE is the URI of the replacement entity to be used. The --add option will not overwrite CATALOGFILE, outputting to stdout, unless --noout is used. The --add will always take three parameters even if some of the XML catalog constructs will have only a single argument. --add FILENAME If the --add option is used following the --sgml option, only a single argument, a FILENAME, is used. This is used to add the name of a catalog file to an SGML supercatalog, a file that contains references to other included SGML catalog files. --create Create a new XML catalog. Outputs to stdout, ignoring filename unless --noout is used, in which case it creates a new catalog file filename. --del VALUE(S) Remove entries from CATALOGFILE matching VALUE(S). The --del option will not overwrite CATALOGFILE, outputting to stdout, unless --noout is used. --noout Save output to the named file rather than outputting to stdout. --no-super-update Do not update the SGML super catalog. --shell Run a shell allowing interactive queries on catalog file CATALOGFILE. For the set of available commands see the section called "SHELL COMMANDS". --sgml Uses SGML super catalogs for --add and --del options. -v, --verbose Output debugging information. SHELL COMMANDS
Invoking xmlcatalog with the --shell CATALOGFILE option opens a command line shell allowing interactive access to the catalog file identified by CATALOGFILE. Invoking the shell provides a command line prompt after which the following commands (described in alphabetical order) can be entered. add TYPE ORIG REPLACE Add an entry to the catalog file. TYPE indicates the type of entry. Possible types are: public, system, rewriteSystem, rewriteURI, delegatePublic, delegateSystem, nextCatalog. ORIG is the original reference to be replaced, and REPLACE is the URI of the replacement entity to be used. The --add option will not overwrite CATALOGFILE, outputting to stdout, unless --noout is used. The --add will always take three parameters even if some of the XML catalog constructs will have only a single argument. debug Print debugging statements showing the steps xmlcatalog is executing. del VALUE(S) Remove the catalog entry corresponding to VALUE(S). dump Print the current catalog. exit Quit the shell. public PUBLIC-ID Execute a Formal Public Identifier look-up of the catalog entry for PUBLIC-ID. The corresponding entry will be output to the command line. quiet Stop printing debugging statements. system SYSTEM-ID Execute a Formal Public Identifier look-up of the catalog entry for SYSTEM-ID. The corresponding entry will be output to the command line. ENVIRONMENT
XML_CATALOG_FILES XML catalog behavior can be changed by redirecting queries to the user's own set of catalogs. This can be done by setting the XML_CATALOG_FILES environment variable to a list of catalogs. An empty one should deactivate loading the default /etc/xml/catalog catalog. DIAGNOSTICS
xmlcatalog return codes provide information that can be used when calling it from scripts. 0 No error 1 Failed to remove an entry from the catalog 2 Failed to save to the catalog, check file permissions 3 Failed to add an entry to the catalog 4 Failed to look up an entry in the catalog SEE ALSO
libxml(3) More information can be found at o libxml(3) web page http://www.xmlsoft.org/ o libxml(3) catalog support web page at http://www.xmlsoft.org/catalog.html o James Clark's SGML catalog page http://www.jclark.com/sp/catalog.htm o OASISXML catalog specification http://www.oasis-open.org/committees/entity/spec.html AUTHOR
John Fleck <jfleck@inkstain.net>. libxml2 $Date: 2006/08/21 08:34:11 $ XMLCATALOG(1)
All times are GMT -4. The time now is 04:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy