write lib function shells