Skip to content

dapx/fnfy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Fnfy

A simple shell alias to create commands

How it works

It's an alias that allows you to create another alias as a command to another command. Did you get it? No? Ok, take a look on how to use it.

How to install

You can install the fnfy alias using the install script:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/dapx/fnfy/master/install.sh)"
. ~/.functions # Load functions after install, or you can simply start a new shell session.

How to use

The syntax is very simple, first you pass the function name and after the command:

$ fnfy aliasname command and arguments

For example, you can use it to create any command like:

$ fnfy saymyname echo My name
$ saymyname
My name

or you can create an useful command like this:

fnfy svg2png inkscape \"\$1\" -b white --export-png=\"\$2\"

Pay attention to escape special characters. Thanks @jvns for the useful svg2png command!

How to show functions

Call the fns alias to show the functions created:

fns

You can also compose with sort to list all functions ordered by name:

fns | sort

How to remove functions

Call the unfnfy alias from any place passing the function name that you want to remove:

unfnfy aliasname

How to uninstall

Remove the load entry from your rc file:

printf "%s\n" "g/^\. ~\/\.functions$/d" w | ed -s ~/.$(basename $SHELL)rc

And if you don't want to keep your functions:

rm ~/.functions

About

A simple shell alias to create commands

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages