minus-squarekayaven@lemmy.worldtoLinux@lemmy.ml•how to create a file and make it executable in one command?linkfedilinkarrow-up13·7 months agoYou could define a function that takes a parameter, which touches a file with the parameters value, chmods it and then opens it with nano? create_exec() { touch "$1" chmod +x "$1" nano "$1" } Then you could type create_exec file.sh and it would do the rest for you. linkfedilink
You could define a function that takes a parameter, which touches a file with the parameters value, chmods it and then opens it with nano?
create_exec() { touch "$1" chmod +x "$1" nano "$1" }
Then you could type
create_exec file.sh
and it would do the rest for you.