Search Results

Search: Posts Made By: cmccabe
21,818
Posted By cmccabe
awk regex woth text in each line
The awk regex below produces the current,where
only the matching line are printed. However, I am trying to print all lines in test.txt,
and if the line matches the first regex the word "good" is...
8,273
Posted By cmccabe
Thank you very much :).
Thank you very much :).
8,273
Posted By cmccabe
awk to print percent based on vales in file
Trying to use awk to calulate a percent based on the count of each matching $5 in file divided by the count of each $7 that is greater than or = to 20. The portion of code before the first | gets the...
20,335
Posted By cmccabe
Thank you very much :).
Thank you very much :).
20,335
Posted By cmccabe
Bash to update file on prefix match in two directories
I am trying to use bash to loop through a directory /path/to/data using a prefix match from /path/to/file. That match is obtained and works using the code below (in green)... what I can not seem to...
10,868
Posted By cmccabe
Got it.... if I want to be able to view these...
Got it.... if I want to be able to view these var, for say troubleshooting, canI? They can be virtual I just may need to verify them. Thank you :)

I think you beat me to it and just posted.
10,868
Posted By cmccabe
So if I am understanding the below should write...
So if I am understanding the below should write each line in config to script.sh to be able to use as variables? By sourceing . $config the config into memory, that will not print the actual...
10,868
Posted By cmccabe
if I just print the $line I do see each var...
if I just print the $line I do see each var printed. However when I re-direct it to the script I do not see them. Are they avaliable to the script to use?

the config file will be different for...
10,868
Posted By cmccabe
The first parameter starting the script is...
The first parameter starting the script is config, there are two possible choices depending on the data type so I am going to pass it as an argument. Thank you :).


config=$1

set -- $config...
10,868
Posted By cmccabe
I get: y being echo on a newline. Thankk you...
I get: y being echo on a newline. Thankk you :).



mkdir TEST && cd $_
echo -e '. $1\necho var' >script.sh
echo 'var=yes' >config
bash script.sh config
yes



y
y
y


should...
10,868
Posted By cmccabe
Pass config file to bash script
I just want to make sure I am understanding how to pass a config file to a bash script . In the below I pass to arguments to a script, then define them in the script as id and config. I then source...
6,617
Posted By cmccabe
Thank you all :)
Thank you all :)
6,617
Posted By cmccabe
Rename file in directory using contents within each file
In the below there are two generic .vcf files (genome.S1.vcf and genome.S2.vcf) in a directory. There wont always be two genaric files but I am trying to use bash to rename each of these generic...
10,106
Posted By cmccabe
I changed the shebang line in the python...
I changed the shebang line in the python executable to #!/usr/bin/env python to match the other .py on my system and get the below error.


python --version on centos 7
Python 2.7.5

...
10,106
Posted By cmccabe
Xargs to call python executable to process multiple bam files
I am running the below loop that to process the 3 bam files (which isn't always the case). A .py executable is then called using | xargs sh to further process. If I just run it with echo the output...
8,942
Posted By cmccabe
I apologize for the delay in response, the script...
I apologize for the delay in response, the script works perfectly.... thank you very much :).
8,942
Posted By cmccabe
The id contains the unique prefix of each bam, so...
The id contains the unique prefix of each bam, so the s1,s2,s3,s4.

I am trying to insert each of those into the command in post 3. That is make the command dependent or conditional on id. So if...
8,942
Posted By cmccabe
I am trying to insert each $id into the standard...
I am trying to insert each $id into the standard command below above the ref following the format -- bam ${id} \. There won't always be
4 $id, that will change each time. Maybe storing each $id in...
8,942
Posted By cmccabe
How to insert a string and variable at specified position in command in bash?
I currently have a loop that reads all .bam files in a directory (wont always be 4 like in this example,
into $id. What I am trying to do, unsucessfully, is create specific new lines in an exsisting...
3,212
Posted By cmccabe
Thank you very much :).
Thank you very much :).
3,212
Posted By cmccabe
awk to average matching lines in file
The awk below executes and is close (producing the first 4 columns in desired). However, when I add the sum of $7, I get nothing returned. Basically, I am trying to combine all the matching $4 in f1...
5,934
Posted By cmccabe
Thank you all :).
Thank you all :).
5,934
Posted By cmccabe
awk to extract value after keyword in html
Using awk to extract value after a keyword in an html, and store in ts. The awk does execute but ts is empty. I use the tag as a delimiter and the keyword as a pattern, but there probably is a better...
8,576
Posted By cmccabe
Thank you both :).
Thank you both :).
8,576
Posted By cmccabe
If any of the below are in $dir then File found...
If any of the below are in $dir then File found was found, moving on.


fileone.csv
fileOne.csv
Fileone.csv
FileOne.csv


If none of those or alike exist, it will echo "File was found and...
Showing results 1 to 25 of 500

 
All times are GMT -4. The time now is 07:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy