I am tired of creating a file with nano, saving it and then making it executable. Is there a command that makes it in one step?
You must log in or register to comment.
You want the install command.
touch file && chmod +x file
is good but this here is the one true command for the purpose.
Write an alias/function to do it and add to your bashrc.
function nanox() { nano "$1" chmod +x "$1" }
This is the way.
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.