#!/bin/bashs='/a/b/c/d.txt/a/b/c/d/e.txtfgh/i/a/b/c.txt'awk -F/ '$NF ~ /\.txt$/{$NF="";print}' OFS=/ <<< "$s"
Standard input is empty
/a/b/c/ /a/b/c/d/ /a/b/
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!