Split a string by awk and print everything but the last two splits [closed]
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 18 days ago . I have a string /home/lamma/local-blast/termitomycesBGI/short_reads/F19FTSEUHT1394.IC0035-2A_1.fq.gz and I am using awk to split the string: echo /home/lamma/local-blast/termitomycesBGI/short_reads/F19FTSEUHT1394.IC0035-2A.fasta.gz | awk -F'.[^.]*$' '{ print $1 }' Which returns: