Skip to content

Julow/save-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Save Go

save and go commands.

save command save the current path.

go command move to the last saved path.

saved command list all saves.

You can name saved paths.

go 1 move you to save 1

go libft move you to save libft

The name is optional.
The name cannot contains white space.

Installation

Add these functions to your rc file. (.zshrc, .bash_aliases, .profile, .bashrc, etc...)

function save()
{
	if [ ! -d ~/save_path ]; then
		mkdir ~/save_path
	fi
	pwd > ~/save_path/$1.save_path;
};

function go()
{
	if [ -f ~/save_path/$1.save_path ]; then
		cd `cat ~/save_path/$1.save_path`;
	else
		echo "The save $1 does not exists.";
	fi
};

function saved()
{
	if [ -d ~/save_path ]; then
		ls -1 ~/save_path | grep ".save_path" | sed -E "s/.save_path$//"
	fi
}

You can change the command name by changing the function name.

About

[Discontinued] --> https://github.com/Julow/My-Shell-Rc

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages