Portable shell functions