Bash alias to create runtime script

Asked

Viewed 71 times

-1

I want to create an alias to make an executable script, already tried to add to .bash_aliases and to the .bashrc
commando: alias mksh='touch $1 && chmod +x $1'

  • @Anderson Carlos Wosss, this...I think the best way is to transform into function, since "alias" does not understand the positional parameters

  • meee does not work on zsh

1 answer

0


use alias + Function:

alias mksh='function __mksh() { touch $*; chmod +x $*; }; __mksh'

you can even use several arguments such as: mksh file1 file2 file3

Browser other questions tagged

You are not signed in. Login or sign up in order to post.