Write your own version of the chmod command.Your solution sh

Write your own version of the chmod command.Your solution should be able to set each of the bits for the group, owner, and world groups.The first argument will be the mode to change the file to and the second argument is the file name.Usage:  chmod MODE FILEInvoking the command with improper usage should display an appropriate help message.Sample run:Given a file named foo.txt:sets the permissions to rwx for each group:./chmod 777 foo.txt sets the permissions to rwx for owner, and — for group and world:  ( -rwx—— )./chmod 700 foo.txt Hint:Remember, to make an octal literal, precede your integer literal with 0.Thus, 0777 would be 777 in octal.You can store ocatls in long integers.long int mode = 0777;Stores octal 777 in variable mode.The chmod function accepts an octal argument.