I have these files which are my input:
library.WTHCG.30678-34569-2789.txt
library.WTHCG.45789-45688-7897.txt
library.WTHCG.56788-67879-7899.txt
library.WTHCG.45678-78987-9097.txt
and I'm running this command:
for i in library*; do
echo sspace ${i#*library.} --o $i;
done
I'm using ${i#*library.} to remove library. from the beginning of the string. But I need to remove library. and .txt after --o at the same time, so that the results looks like:
sspace WTHCG.30678-34569-2789.txt --o WTHCG.30678-34569-2789
sspace WTHCG.45789-45688-7897.txt --o WTHCG.45789-45688-7897
sspace WTHCG.56788-67879-7899.txt --o WTHCG.56788-67879-7899
sspace WTHCG.45678-78987-9097.txt --o WTHCG.45678-78987-9097