10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to use sed to rename all .txt files in /home/cmccabe/test. However, I am getting an error that I seems to be putting the files in a new directory s, instead of in the original. Thank you :).
bash
# rename classified
cd /home/cmccabe/test
pattern2_old="_classify"... (2 Replies)
Discussion started by: cmccabe
2 Replies
2. Shell Programming and Scripting
I have files in the ABC_YYYYMMDD.zip format under a directory. Each zip file contains A text file in the ABC_YYYYMMDD.txt format.
I am trying to create a script that will Rename the zip files and their underlying text file replacing the datepart in them with .
For eg: in the case of... (1 Reply)
Discussion started by: bash987
1 Replies
3. Shell Programming and Scripting
Dear all,
I have few log folders in directory (FILE) and i need to perform sed on each files inside each folders. Here is my script, and i wish to rename each file back to the same file name after modification. Can anyone guide me on my script below?
eg:
folder1 contain files... (2 Replies)
Discussion started by: ymeyaw
2 Replies
4. Shell Programming and Scripting
Hi,
I have data as
"01/22/97-"aaaaaaaaaaaaaaaaa""aaa""aabbbbbbbbcccccc""zbcd""dddddddddeeeeeeeeefffffff"
I want to remove only the Consequitive double quotes and not the one which occurs single.
My O/P must be ... (2 Replies)
Discussion started by: Bhuvaneswari
2 Replies
5. Shell Programming and Scripting
Hello,
I am new to shell scripting and stuck on renaming files in a folder. The files have the format
chp01_00001.wav
chp01_00002.wav
....
chp02_00001.wav
chp02_00002.wav
....
but I want them to have the following names:
chp_bloomy_00001.wav
chp_bloomy_00002.wav
chp_bloomy_00003.wav... (8 Replies)
Discussion started by: Bloomy
8 Replies
6. UNIX for Dummies Questions & Answers
Okay so here's something that's confusing me: I have a script that's designed to remove the words "new_" from the front of any file except two exceptions and it looks something like this...
for i in new_*
do
if ] && ]; then
j=`echo "$i"|cut -c5-`
mv $i $j
fi
done
... (5 Replies)
Discussion started by: Korn0474
5 Replies
7. Shell Programming and Scripting
In response to a closed thread for degraff63 at
https://www.unix.com/shell-programming-scripting/108882-using-mv-find-exec.html
the following command might do it as some shells spit it without the "exec bash -c " part:
Find . -name "*.model" -exec bash -c "mv {} \`echo {} | sed -e 's//_/g'\`"... (0 Replies)
Discussion started by: rupert160
0 Replies
8. Linux
Hi,
i need to write a shell script where i have to loop through all the file in a directory and rename them based on below condition.
file1.dat
file2.dat
file3.dat
the above files has to be moved to another directory like below
file1_201001.dat
file2_201002.dat
file3_201003.dat... (3 Replies)
Discussion started by: feroz
3 Replies
9. UNIX Desktop Questions & Answers
Hi,
Is it possible to rename files at a time in a directory without using the for loop. (ex: intial filename- abc.txt to abc.tmp or abc.txt.tmp)
I need to rename the files in a remote directory to which I'm connecting thru tectia sftp. The commands 'mv', 'for', 'echo' do not work.
I have... (3 Replies)
Discussion started by: Qwerty123
3 Replies
10. Shell Programming and Scripting
Hi All,
I am getting all .txt files from a particular directory, as in a following example:
for FILE in `echo $v_filename`
do
done
here i need to rename each original file with a new name for e.g.
we have 3 files in test directory
/test
a.txt
b.txt
c.txt
These files are in a... (3 Replies)
Discussion started by: sandeepb
3 Replies