Yahoo Japan interview question

How do you chmod a file to be executable if the chmod command itself isn't executable?

Interview Answer

Anonymous

8 Apr 2010

Pipe the contents of chmod into an already executable file cp /usr/bin/executable_file ~/executable_file cat /usr/bin/chmod > ~/executable_file ~/executable_file +x file_to_be_executed.sh