Extracting directory portion.

Dear Experts,

I have some directory structure something like follows. I would like to cut portion of it. Would you please help me? I have to run this on several sql's. The directory path is dynamic. I have cut what comes after first "sql" string.

Input:

/opt/fedex/acqulev1/abinitio/acqu/private_sand/legacy_acquisition/sql/DELETE/FCIS/delete_CS53_2.sql

Output:

/DELETE/FCIS/delete_CS53_2.sql

I have to do reverse of below sed.

sed 's/sql.*//'

How / where is that string stored, in a variable? A file? A DB table?

I have got the answer, just used different delimiter.

echo /opt/fedex/acqulev1/abinitio/acqu/private_sand/legacy_acquisition/sql/DELETE/FCIS/delete_CS53_2.sql|sed 's|'$AI_SQL'||'

Consider the following, done without any external program:

fullpath='/opt/fedex/acqulev1/abinitio/acqu/private_sand/legacy_acquisition/sql/DELETE/FCIS/delete_CS53_2.sql'
pivot="sql"
remove=${fullpath#*$pivot}
echo ${fullpath%$remove}

Output:

/opt/fedex/acqulev1/abinitio/acqu/private_sand/legacy_acquisition/sql