strip leading slash when editing file
add trailing newline to execute command output