#!/bin/sh
dir=/tmp
fnam=someshellscript
echo '#!/bin/sh' > $dir/$fnam
echo 'find /bin -name "*X*"' >> $dir/$fnam
chmod 755 $dir/$fnam
create a shell script with a shell script (mac)
-
13-06-2023 - |
Pregunta
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.
Solución
Otros consejos
#!/bin/sh
echo "script goes here!" > /path/to/place
chmod 755 /path/to/place
?
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow