Sponsored Content
Top Forums Shell Programming and Scripting write shell script to rename file Post 302479149 by shubhig15 on Friday 10th of December 2010 01:39:40 AM
Old 12-10-2010
Quote:
Originally Posted by michaelrozar17
It depends upon your requirement. Wot exactly your trying to do.. i mean from where to where your trying to move the files and wot is the destination file name for the move command. Is it always tmp.xml? Brief the requirements.

FROMDIR=/root/test/data
TODIR=/root/test/data1

data directory contains file tmp_2.0_20101208_34.xml and data1 contains file tmp.xml.I want to move tmp_2.0_20101208_34.xml file into data1 folder and after that its name replace with tmp.xml because other application using this tmp.xml.If user do any modification in this tmp_2.0_20101208_34.xml file than he save the name of the file as tmp_2.0_20101209_35.xml again this file is moved in data1 folder and name changed as tmp.xml.Destination file name is always tmp.xml
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Shell script to rename or change file extension case.

I searched the forum, but there was different type of rename. Hello. I have files in folder. Like: xxxxxxxx1.html or xxxxxxxx2.txt or xxxxxxxx3.tar.gz and how to rename or change file extension case to xxxxxxxx1.htm or xxxxxxx2.TXT or (5 Replies)
Discussion started by: Sheldon
5 Replies

2. Shell Programming and Scripting

How to write a shell script to notify when certain texts appear in a file?

I have a server and occasionally the file mysqld.log would show something like /usr/libexec/mysqld: Disk is full writing './example_com_-_wordpress/wp_statpress.MYD' (Errcode: 122). Waiting for someone to free space... Retry in 60 secs How do I write a simple shell script to check mysqld.log... (1 Reply)
Discussion started by: acider
1 Replies

3. UNIX for Advanced & Expert Users

Rename a file to a file_current datetime in a shell script

Hi all, Could anyone suggest me on Renaming a file to a file_current datetime in a shell script. (3 Replies)
Discussion started by: Nithin
3 Replies

4. Shell Programming and Scripting

write shell script to search file in folder

hi .. i have a problem how to search file with date and version number(ms_2.0_dd/mm/yy_24)in folder.Here 24 is version number and compare the this file to other file which is in another folder and if does not match then copy this file to respective folder.Also copy different files in different... (1 Reply)
Discussion started by: shubhig15
1 Replies

5. Shell Programming and Scripting

Write output to a file using Korn shell script

All, Can anyone please help me with the below scenario in korn shell script. Can anyone please give me some hints to proceed on this. I have a Flat file of the below format. Input file format:... (1 Reply)
Discussion started by: sp999
1 Replies

6. Shell Programming and Scripting

how to write multiple lines to a file using shell script?

I need to create an xml using shell script, but i first want to know how can i write multiple lines to file using shell script? (7 Replies)
Discussion started by: vel4ever
7 Replies

7. Shell Programming and Scripting

How can I write the specific content in the file through shell script

Hello, I need to do one thing that my script creates the file touch release.SPLASH_12_03_00_RC01.txt Now I want to update that file with some content e.g splashbuild::SPLASH_12_17_00_RC02.zip Thanks (1 Reply)
Discussion started by: anuragpgtgerman
1 Replies

8. Shell Programming and Scripting

How to write rename script?

I have files fd01.calc,fd02.calc,fd03.calc..I want to rename in fd01.picks,fd02.picks,fd03.picks How to do this? (4 Replies)
Discussion started by: mikibelavista
4 Replies

9. Shell Programming and Scripting

Need help to write a shell script to convert text file to excel file.

Hi Everyone, I want your help to write a script which will take text file as input and on the basis of delimiter ":"script will create excel sheet. Example input: IpAdress:InstanceName:Port:ServerName 10.255.255.1:abc:2232:xyz_abc Output should be an excel sheet like below: Column... (8 Replies)
Discussion started by: akabhinav18
8 Replies

10. Shell Programming and Scripting

Help required with a file rename shell script

Hello everyone, Posting here after a long time, been away from unix world lately and it seems I have forgotten my shell scripting completely. I have a requirement where a csv file contains following columns: Full Registration VIN Stock... (14 Replies)
Discussion started by: tayyabq8
14 Replies
STAG-PARSE(1p)						User Contributed Perl Documentation					    STAG-PARSE(1p)

NAME
stag-parse - parses a file and fires events (e.g. sxpr to xml) SYNOPSIS
# convert XML to IText stag-parse -p xml -w itext file1.xml file2.xml # use a custom parser/generator and a custom writer/generator stag-parse -p MyMod::MyParser -w MyMod::MyWriter file.txt DESCRIPTION
script wrapper for the Data::Stag modules feeds in files into a parser object that generates nestarray events, and feeds the events into a handler/writer class ARGUMENTS
-p|parser FORMAT FORMAT is one of xml, sxpr or itext, or the name of a perl module this is the class that parsers the input file(s) and generates stag events xml assumed as default -w|writer FORMAT FORMAT is one of xml, sxpr or itext, or the name of a perl module this is the class that catches the events thrown by the parser; it can be any class, but the class is typically a writer xml assumed as default -o|out FILE the writer will use this file (defaults to STDOUT) -e|errf FILE file to store parse error handler output -errhandler FORMAT/MODULE FORMAT is one of xml, sxpr or itext, or the name of a perl module all parse error events go to this module -r|root NODE_NAME if this is specified, NODE_NAME becomes the root of the stag tree, and anything that was previously the root is placed below this. this happens automatically if more than one file is parsed (because there can only be one tree root) -color Works only if the output handler is able to provide ASCII-colors (currently supported for itext and xml) SEE ALSO
Data::Stag This script is a wrapper for the method Data::Stag->parse() perl v5.10.0 2008-12-23 STAG-PARSE(1p)
All times are GMT -4. The time now is 02:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy