Skip to content
This repository has been archived by the owner. It is now read-only.

bynect/shell-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Various shell scripts

These are some shell scripts that you can put in your path or in your *.rc file and that will make your shell coding easier.

Touchm

Stands for TouchMake, and as the name says, it can touch a file and make a dir. With this command you can create a file and its parent dirs in one command. Combines mkdir and touch to simplify boring process like creating directory structure.

#the regular touch command
$ touch path/to/file.txt
touch: cannot touch 'path/to/file.txt': No such file or directory

#touchm solves this
$ touchm path/to/file.txt

Without args touchm will warn you like the regular touch.

$ touchm
Missing file operand

Note: touchm checks if the given path is valid using pathchk.

Windows version

There is a Windows version of touchm made with batch that works like the Linux one. To use it in your terminal you have to add the batch script to your path.

Cdm

Stands for CDMake, and the name says it all. Combines mkdir and cd (actually pushd) to create a directory and move you into that new directory. You can create multiple dirs but you will be moved only to the first one.

Note: You cannot use the script in a script file, and you have either to source the file (source path/to/cdm) or to add it directly to you .*rc file (better).

#from this command
$ mkdir -p ./my/project && cd ./my/project

#to this command
$ cdm ./my/project

You can use cdm without args and it will bring you back to the most recent directory on stack (using popd).

#cdm without args will move you back
$ cdm

Note: cdm checks if the given path is valid using pathchk.

License

Licensed under MIT License. This code is open source and always will be.

About

Various utility script that will make your shell coding easier.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published