Understanding bash programing