porting of old bash features