shell command to the following question
1
0
Entering edit mode
2.8 years ago

Hello everyone

I have small problem in running shell command. Currently I am trying to retrieve file from the folders using for-loop. Here is input folder name

TC1-T1
TC1-T2
TC1-T3
TC1-T4
TC1-T5
TC1-T6
TC1-T7
TC1-T8
TC1-T9
TC1-T10
TC2-T1
TC2-T2
TC2-T3
TC2-T4
TC2-T5
TC2-T6
TC2-T7
TC2-T8
TC2-T9
TC2-T10

I want the output as

TC1-T2
TC1-T4
TC1-T6
TC1-T8
TC2-T2
TC2-T4
TC2-T6
TC2-T8
TC2-T10

I tried to use the following code but it did not work.

  for pair in "TC"{1..2} -"T"{1..10}; do for i in $pair; do printf ${i+1} printf "\n" done done
linux offtopic • 823 views
ADD COMMENT
0
Entering edit mode

This post does not fit the theme of this forum - how is this related to bioinformatics?

ADD REPLY
2
Entering edit mode
2.8 years ago
Dunois ★ 2.5k

Your question is rather ill-defined. ls TC*-T*[02468]* technically does what you're looking to do?

ADD COMMENT
0
Entering edit mode

Thank you so much. It worked for me.

ADD REPLY

Login before adding your answer.

Traffic: 2385 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6