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.

有帮助吗?

解决方案

#!/bin/sh

dir=/tmp
fnam=someshellscript

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

其他提示

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

?

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top