Sponsored Content
Top Forums Shell Programming and Scripting write shell script to rename file Post 302478889 by shubhig15 on Thursday 9th of December 2010 06:16:16 AM
Old 12-09-2010
write shell script to rename file

hi,
I need some help in writing shell script in a bourne shell.I am trying to rename the file..
eg.
Code:
find /root/data -type f -name "text*) | while read FILES
do
  newfile=${FILES/type_2.0_20101208_34.xml / tmp.xml}
  mv "$FILES" "$newfile"
done

above written script is working...If the name of my file is changed into type_2.0_20101208_35.xml so i have to write this filename in script.Every time when file name is change i have to change the the file name in script..But i do not want to editing in script to change the name of file..so what i write in place of type_2.0_20101208_34.xml in code..
Please help me to overcome this problem,...

Last edited by Franklin52; 12-09-2010 at 07:17 AM.. Reason: Please use code tags and indent your code, thanks
 

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

NAME
scilab - Scientific software package for numerical computations SYNOPSIS
scilab [ -h | -f file | -e instruction | -l lang | -mem n | -nw | -nwni | -nogui | -nb | -ns | -nouserstartup | -version ] This manual page documents briefly the scilab commands. OPTIONS
A complete list of options is included below. -h Show the list of options. -f file Execute the scilab script given in file argument. Note that -e and -f options are mutually exclusive. -e instruction Execute the scilab instruction given in instruction argument. Note that -e and -f options are mutually exclusive. -nw Start Scilab without specialized Scilab Window. -nwni start Scilab without the GUI, graphic and help features (batch mode). This option disable the need of Java. -nogui start Scilab without user GUI (batch mode). -l lang Launch Scilab in the specified language. The lang must be the locale code (ie fr_FR, en_US...) -nb Do not display the Scilab banner at starting time. -ns Do not execute scilab.start startup file -mem N Set the initial stacksize -nouserstartup Do not execute the user startup files SCIHOME/.scilab or SCIHOME/scilab.ini. -version Print product version and exit. FILES
~/.Scilab/<Scilab_version>/.scilab The user startup script. ~/.Scilab/<Scilab_version>/scilab.ini The user startup script. ~/.Scilab/<Scilab_version>/configuration.xml The configuration of the GUI ~/.Scilab/<Scilab_version>/.history.scilab The history of commands SCI/modules/jvm/etc/jvm_options.xml Options given to the JVM SCI/etc/modules.xml List of Scilab modules SCI/etc/classpath.xml Where Scilab should load the Java libraries SCI/etc/librarypath.xml Where Scilab should look for JNI libraries AUTHOR
Scilab was written by the Scilab Consortium. This manual page was written by Sylvestre Ledru <sylvestre@debian.org>. November 18, 2008 Scilab(1)
All times are GMT -4. The time now is 04:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy