Question

I've been creating mac shell executables with this method:

  • Create a file;
  • Add #!/bin/sh;
  • Add the script;
  • Run chmod 755 nameofscript.

I now need to create a shell script to create a shell script in another directory and make it executable (with chmod) so that it can be run on startup.

Was it helpful?

Solution

#!/bin/sh

dir=/tmp
fnam=someshellscript

echo '#!/bin/sh' > $dir/$fnam
echo 'find /bin -name "*X*"' >> $dir/$fnam
chmod 755  $dir/$fnam

OTHER TIPS

#!/bin/sh
echo "script goes here!" > /path/to/place
chmod 755 /path/to/place

?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top