10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
In the portion of bash below I am using rename to match the $id variable to $file and when a match (there will alwsys be one) is found then the $id is removed from each bam and bam.bai in $file and _test is added to thee file name before the extension. Each of the variables is set correctly but... (3 Replies)
Discussion started by: cmccabe
3 Replies
2. Shell Programming and Scripting
I am trying to mv each of the .vcf files in the variants folder to the folder in /home/cmccabe/f2 that the .vcf id is found in file. $2 in file will always have the id of a .vcf in the variants folder. The line in blue staring with R_2019 in file up to the -v5.6 will always be an exact match to a... (4 Replies)
Discussion started by: cmccabe
4 Replies
3. Shell Programming and Scripting
In the bash below I am trying to create sub-directories inside a directory from files with specific .bam extensions. There may be more then one $RDIR ing the directory and the .bam file(s) are trimmed (removing the extension and IonCode_0000_) and the result is the folder name that is saved in... (2 Replies)
Discussion started by: cmccabe
2 Replies
4. Shell Programming and Scripting
I am trying to rename all text files in a directory that match a pattern. The current command below seems to be using the directory path in the name and since it already exists, will not do the rename. I am not sure what I am missing? Thank you :).
Files to rename in... (3 Replies)
Discussion started by: cmccabe
3 Replies
5. Shell Programming and Scripting
I am using bash to prompt a user for a choice using: where a "y" response opens a menu with available panels that can be used.
while true; do
read -p "Do you want to get coverage of a specific panel?" yn
case $yn in
* ) menu; break;;
* ) exit;;
* ) echo... (6 Replies)
Discussion started by: cmccabe
6 Replies
6. Shell Programming and Scripting
Hello,
I have multiple files named rscclog_2013-03-25.txt;3 in a directory, where 2013-03-25 is the previous day's date and the number after extension .txt preceded by a ';' is any number which i do not know beforehand.
Now, i have to rename all such files as rscclog_2013-03-25.txt
thus,... (2 Replies)
Discussion started by: rahulkt1987
2 Replies
7. Shell Programming and Scripting
I have a list file that contains names of many files. I am reading one file name at a time using for loop
Then I like to create one more list file but with the file extension changed to "ctl".
Note: The file name can have any number of dots ".". But the extension after the last dot should be... (4 Replies)
Discussion started by: pinnacle
4 Replies
8. Shell Programming and Scripting
Hi,
I am trying to make all file in the directory uppercase but not their extension (ex: image.jpg becoming IMAGE.jpg)
here is code i am trying.
$ ls | while read file
do
name=${file%%.*}
newfilename=$(echo $name | tr 'a-z' 'A-Z')
mv $file $newfilename
done
any suggestions of... (4 Replies)
Discussion started by: johninweb
4 Replies
9. Shell Programming and Scripting
Hi guys,
i had many files like filename.20110520_20110519_050030
i have to rename the file by removint the last numerics ..
i.e filename.dat
i tried with cut command and removed the numerics but i'm not able to add .dat to the files.
is there any command insted of cut command to... (1 Reply)
Discussion started by: apple2685
1 Replies
10. Shell Programming and Scripting
I am trying for loop to rename file extension from .txt to .html :
as below :
for i in *.txt; do mv "$i" `basename $i`.html; done
-------------------------------------------
But this renames a file file1.txt as file1.txt.html
anyone know how get avoid .html added after .txt ?
it... (4 Replies)
Discussion started by: sriram003
4 Replies