Copied/refactored attribute shell script