Hi, I'm confused about the usage of 'awk' in ipython.<br><br><pre class="default prettyprint"><code><span class="pln">For example: I want to create 3 files('chr1','chr2','chr3'). And I input the following commands:<br>
a=['chr1','chr2','chr3']<br>for eachitem in a:<br> !awk '{print $1}' '/home/ckivip/Epigenetics/Data/H1hesc/Dnamethy.bed' > '/home/ckivip/Epigenetics/Data/H1hesc/Dnamethy/$$eachitem'<br>
<br>However, I only get files named '16484eachitem','16486eachitem','16488eachitem'!! What do those mean?<br>And my question is how can I convert variables to shell from python in this situation. it can't recognize <br>
the variable '$$eachitem'. So how can I deal with it?<br><br><br></span></code></pre><br>-- <br>Peng Cui<br><font face="Verdana"><font face="Verdana"><span>Department of Bioinformatics & Biostatistics, Shanghai Jiao Tong University</span></font></font><br>
<font face="Verdana"><font face="Verdana"><span>800 Dongchuan
Road<span>,</span>Shanghai 200240<span>,</span>China</span></font></font><br><br>