I've trawled through similar questions to this, but can't quite find something that works, and wondered if you could kindly help.
I am trying to execute the following bash script:
#!/bin/bash
for i in {0..10000}
do
mysql --user=genome --host=genome-mysql.cse.ucsc.edu -A -D hg19 -e '
Select
S.name as rsID,
S.chrom,
S.chromEnd,
S.chromStart,
K.txStart,
K.txEnd,
G.geneSymbol,
G.kgID
from snp138 as S
left join knownGene as K on
(S.chrom=K.chrom and not(K.txEnd+1000000<S.chromStart or S.chromEnd+1000000<K.txStart))
right join kgXref as G on
(K.name=G.kgID)
where
S.name in ("snp_permutation"$i".txt")'| awk -F '|' '{print $1}' | sed 1d | awk '{print $7}' | sort -u > permutation"$i"_genelist.txt
Essentially, I have 10,000 files called snp_permutation"$i".txt, where i runs from 1 to 10,000. Each of these files is just a single line, and its only content looks something like:
rs16574876
For this script to work, I need the actual content of the files (e.g. "rs16574876" to go between the quotation marks in S.name in ("snp_permutation"$i".txt")', rather than the name of the file itself.
Do I need to use source or export for this?
Thank you for your help.
i=1; echo 'The value is ("snp_permutation"$i".txt)'and then solve each problem until you get it to writeThe value is (42). But to answer your question: no, you do not need to (and can't) use source or export for this.