Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Changing old file name to new one if the old file name satisfied certain condition Post 302168134 by balzzz on Sunday 17th of February 2008 08:28:13 AM
Old 02-17-2008
Changing old file name to new one if the old file name satisfied certain condition

Hi guys,

I desperately need your help on my problem:-

I got a folder in my directory that has many files in it. Most of the file's name is starting with certain prefix. Eg: ABC, CDE, EFG, etc. I only want to change file name that is starting from certain prefix and the rest I want them to remain the same. For example: I want to change the file name that has prefix ABC and CDE only to ADD_ABC, ADD_CDE and the EFG I want it to remain unchanged.

I want to put all the file name prefix that I want to change into a txt file and run a script based on the condition that I set.

Can you all please shed some light on this matter? I really clueless on how to link the script ( mv command) to the txt file.

Thanks in advance
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

print remaining file after a condition is satisfied

Hi , could any one suggest me that how to determine if the first field is numeric and if it is greater than another number then from that point everything else should be printed using awk. I have tried this : awk -v xxxx=$xxxxx ' BEGIN { enable=0 } { print $1 if ( ( $1 !~ "^*$" ... (5 Replies)
Discussion started by: hitmansilentass
5 Replies

2. Shell Programming and Scripting

how to create folder wen the condition satisfied

hi i hav files ha1j ha2m ha3n ha4q ha5s ...like tat im having some 20 files ..and i want to create a folder as the same amount of files which im having wen the condition if loop is satisfied .. thank you (5 Replies)
Discussion started by: maximas
5 Replies

3. UNIX for Advanced & Expert Users

How to parse through a file and based on condition form another output file

I have one file say CM.txt which contains values like below.Its just a flat file 1000,A,X 1001,B,Y 1002,B,Z ... .. total around 4 million lines of entries will be in that file. Now i need to write another file CM1.txt which should have 1000,1 1001,2 1002,3 .... ... .. Here i... (6 Replies)
Discussion started by: sivasu.india
6 Replies

4. UNIX for Dummies Questions & Answers

until loop : running even if condition is satisfied

I am checking one until loop with the following logic until || |||| do sleep 30 done before running this i am exporting above variables to SUCCESS.But the loop is running in infinite loop.My requirement is to make the loop run until all the 3 variables are SUCCESS or any of the 3... (2 Replies)
Discussion started by: dr46014
2 Replies

5. Shell Programming and Scripting

If condition to check one file newer than the other - first file name uncertain

Dear All, I'm new to unix scripting. I'm trying to write an utility script which has to check if one file is newer than another one. The condition is I dont know the full name of the first file. I searched google and this forum for any such examples, but couldn't find any or may be I would have... (9 Replies)
Discussion started by: achilles5
9 Replies

6. Shell Programming and Scripting

changing csv file contents to file of rows

i have a file a.txt contents as 1,2,3,4,......etc...in a single line, i want to write to another file in rows as 1 2 3 4 5 can u help? i do not know the length of a.txt (4 Replies)
Discussion started by: pravfraz
4 Replies

7. UNIX for Dummies Questions & Answers

Changing file content based on file header

Hi, I have several text files each containing some data as shown below: File1.txt >DataHeader Data... Data... File2.txt >DataHeader Data... Data... etc. What I want is to change the 'DataHeader' based on the file name. So the output should look like: File1.txt >File1 ... (1 Reply)
Discussion started by: Fahmida
1 Replies

8. Shell Programming and Scripting

changing a file when the inode modified time of the other file changes

i have a requirement where i needed to change variable values in a properties file(first file) whenever there is change to Release details file(second file). My question is do i have to create a daemon process that always checks the modified time/inode change of the second file and then change the... (1 Reply)
Discussion started by: saikiran_1984
1 Replies

9. Shell Programming and Scripting

Changing file permissions of a file created by another user

Hi, I have used expdp for datapump. The .dmp file is created by the "oracle" user. my requirement is to make a zipped file of this .dmp file. What i am trying to do is change the permissions of this .dmp file from 0640 to 0644 and then do a gzip and zip it. Is there any way i can change... (3 Replies)
Discussion started by: qwertyu
3 Replies

10. Shell Programming and Scripting

If both condition satisfied

pattern tin loop 3 tin xarg 1 tin jim 5 tin icon 2 tin tour 4 patn.out tin loop 3 tin jim 5 tin icon 1 tin tour 2 while read one two three do awk '$2 ~ /'"$two"'/' patn.out || while read four five six do awk -v n1=$three -v n2=$six '{BEGIN (n2<n1)?1:0}' done<patn.out... (3 Replies)
Discussion started by: Roozo
3 Replies
IJS-CONFIG(1)						      General Commands Manual						     IJS-CONFIG(1)

NAME
ijs-config - script to get information about the installed version of ijs SYNOPSIS
ijs-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags] DESCRIPTION
ijs-config is a program that is used to determine the compiler and linker flags that should be used to compile and link programs that use IJS. OPTIONS
This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. --help Show summary of options. This may list additional advanced package configuration options not detailed in this manual page. --version Show installed libijs version. --libs Print the linker flags that are necessary to link an IJS program. --cflags Print the compiler flags that are necessary to compile an IJS program. --prefix=PREFIX If specified, use PREFIX instead of the installation prefix that IJS was built with when computing the output for the --cflags and --libs options. This option is also used for the exec prefix if --exec-prefix was not specified. This option must be specified before any --libs or --cflags options. --exec-prefix=PREFIX If specified, use PREFIX instead of the installation exec prefix that IJS was built with when computing the output for the --cflags and --libs options. This option must be specified before any --libs or --cflags options. SEE ALSO
gtk-config(1) AUTHOR
This manual page was written by Roger Leigh <rleigh@debian.org>, originally for the Debian GNU/Linux system. 5 Feb, 2004 IJS-CONFIG(1)
All times are GMT -4. The time now is 08:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy