[shell] Extract directory path and filename