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 have a file with following data.
{
EqName "Tan 1"
....
....
}
{
EqName "Sin 2"
...
...
}
I have to replace the value of EqName to Tan_1 and Sin_2 in file.Can i use sed or awk ?
cat file|grep EqName|awk '{print $2 $3}'|sed -i 's//_/g'
I tried with this but it... (2 Replies)
Discussion started by: Jag02
2 Replies
3. Shell Programming and Scripting
In the below bash I am trying to copy the only text file (always only one) in /home/cmccabe/Desktop/list/QC/metrics.txt and rename each of the 3 text files according to /home/cmccabe/Desktop/test/list.txt using lines 3, 4 ,5. This format (that is list.txt) is always 5 lines. Thank you :).
... (12 Replies)
Discussion started by: cmccabe
12 Replies
4. Shell Programming and Scripting
I have a specific set (all ending with .bam) of downloaded files in a directory /home/cmccabe/Desktop/NGS/API/2-15-2016. What I am trying to do is use a match to $2 in name to rename the downloaded files. To make things a more involved the date of the folder is unique and in the header of name... (1 Reply)
Discussion started by: cmccabe
1 Replies
5. Shell Programming and Scripting
I'm trying to create a bash function that will allow me to rename a file name emails.txt to last monday's date
renem ()
{
d=`date -d last-monday`
mv ~/emails.txt ~/myemails/$d
}
but i en up wit this error any suggestion
mv: target `2014' is not a directory (3 Replies)
Discussion started by: robshal
3 Replies
6. Shell Programming and Scripting
I want to rename all files and folder containing underscore in name and replace underscore with hyphen.
Currently I am using following code,
rename '_' '-' */*/*
It was working but now it is showing me "Argument list too long"
Please help! (2 Replies)
Discussion started by: opticalpigion
2 Replies
7. Shell Programming and Scripting
Hello All,
Bash Version: 4.1.10(1)
I'm trying to "verify" some user input. The User input will contain the "Absolute Path" a "Command" and any "Options"
of that Command.
For Example, say the user's input is:
user_input="/usr//local/myExample/check_process -p 'java' -w 10 -c 20"
I... (6 Replies)
Discussion started by: mrm5102
6 Replies
8. Shell Programming and Scripting
HI,
I have a file serverlist in that all host names are placed.
i have written a small script
#./testping
#! /bin/bash
for i in `cat serverlist`
do
ping $i >> output.txt
done
so now it creates a file output.txt till here fine..
now each time i run this script the output file... (4 Replies)
Discussion started by: madhudeva
4 Replies
9. Shell Programming and Scripting
Hi,
I have two types of file names
filename1_12345 or filename1-12345 at the same time I have second type
filename2-12345 in a txt file.
I am trying to write awk script that will sort these names with below pattern
ALL file names like
filename1_12345 and filename1-12345 will go to... (1 Reply)
Discussion started by: rider29
1 Replies
10. Shell Programming and Scripting
Basically, I have a huge amount of files (ripped audiobooks) that all have the same garbage in their filenames. I'm wondering how to go about writing a bash script to mass rename them. Example filenames as they stand now:
The First CD - 1x01 - Title 1.mp3
The First CD - 1x02 - Title 2.mp3... (4 Replies)
Discussion started by: audiophile
4 Replies