autoscript 233 B

12345678910111213141516171819
  1. #!/usr/bin/env bash
  2. scripts_dir="$HOME/.local/bin"
  3. script_file="$scripts_dir/$1"
  4. if [[ -f $script_file ]]; then
  5. vim $script_file
  6. else
  7. echo '#!/usr/bin/env bash
  8. ' > $script_file
  9. chmod +x $script_file
  10. vim $script_file
  11. fi