Merge pull request #315 from Jeraimee/master
Updating function declarations to avoid parse errors in some bash versionspull/307/merge
commit
e0c48b1637
|
|
@ -1,14 +1,14 @@
|
||||||
cite about-plugin
|
cite about-plugin
|
||||||
about-plugin 'miscellaneous tools'
|
about-plugin 'miscellaneous tools'
|
||||||
|
|
||||||
ips ()
|
function ips ()
|
||||||
{
|
{
|
||||||
about 'display all ip addresses for this host'
|
about 'display all ip addresses for this host'
|
||||||
group 'base'
|
group 'base'
|
||||||
ifconfig | grep "inet " | awk '{ print $2 }'
|
ifconfig | grep "inet " | awk '{ print $2 }'
|
||||||
}
|
}
|
||||||
|
|
||||||
down4me ()
|
function down4me ()
|
||||||
{
|
{
|
||||||
about 'checks whether a website is down for you, or everybody'
|
about 'checks whether a website is down for you, or everybody'
|
||||||
param '1: website url'
|
param '1: website url'
|
||||||
|
|
@ -17,7 +17,7 @@ down4me ()
|
||||||
curl -s "http://www.downforeveryoneorjustme.com/$1" | sed '/just you/!d;s/<[^>]*>//g'
|
curl -s "http://www.downforeveryoneorjustme.com/$1" | sed '/just you/!d;s/<[^>]*>//g'
|
||||||
}
|
}
|
||||||
|
|
||||||
myip ()
|
function myip ()
|
||||||
{
|
{
|
||||||
about 'displays your ip address, as seen by the Internet'
|
about 'displays your ip address, as seen by the Internet'
|
||||||
group 'base'
|
group 'base'
|
||||||
|
|
@ -26,7 +26,7 @@ myip ()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pickfrom ()
|
function pickfrom ()
|
||||||
{
|
{
|
||||||
about 'picks random line from file'
|
about 'picks random line from file'
|
||||||
param '1: filename'
|
param '1: filename'
|
||||||
|
|
@ -39,7 +39,7 @@ pickfrom ()
|
||||||
head -n $n $file | tail -1
|
head -n $n $file | tail -1
|
||||||
}
|
}
|
||||||
|
|
||||||
pass ()
|
function pass ()
|
||||||
{
|
{
|
||||||
about 'generates random password from dictionary words'
|
about 'generates random password from dictionary words'
|
||||||
param 'optional integer length'
|
param 'optional integer length'
|
||||||
|
|
@ -53,7 +53,7 @@ pass ()
|
||||||
echo "Without (use this as the pass): $(echo $pass | tr -d ' ')"
|
echo "Without (use this as the pass): $(echo $pass | tr -d ' ')"
|
||||||
}
|
}
|
||||||
|
|
||||||
pmdown ()
|
function pmdown ()
|
||||||
{
|
{
|
||||||
about 'preview markdown file in a browser'
|
about 'preview markdown file in a browser'
|
||||||
param '1: markdown file'
|
param '1: markdown file'
|
||||||
|
|
@ -67,7 +67,7 @@ pmdown ()
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
mkcd ()
|
function mkcd ()
|
||||||
{
|
{
|
||||||
about 'make a directory and cd into it'
|
about 'make a directory and cd into it'
|
||||||
param 'path to create'
|
param 'path to create'
|
||||||
|
|
@ -78,7 +78,7 @@ mkcd ()
|
||||||
cd "$*"
|
cd "$*"
|
||||||
}
|
}
|
||||||
|
|
||||||
lsgrep ()
|
function lsgrep ()
|
||||||
{
|
{
|
||||||
about 'search through directory contents with grep'
|
about 'search through directory contents with grep'
|
||||||
group 'base'
|
group 'base'
|
||||||
|
|
@ -86,7 +86,7 @@ lsgrep ()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pman ()
|
function pman ()
|
||||||
{
|
{
|
||||||
about 'view man documentation in Preview'
|
about 'view man documentation in Preview'
|
||||||
param '1: man page to view'
|
param '1: man page to view'
|
||||||
|
|
@ -96,7 +96,7 @@ pman ()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pcurl ()
|
function pcurl ()
|
||||||
{
|
{
|
||||||
about 'download file and Preview it'
|
about 'download file and Preview it'
|
||||||
param '1: download URL'
|
param '1: download URL'
|
||||||
|
|
@ -105,7 +105,7 @@ pcurl ()
|
||||||
curl "${1}" | open -f -a $PREVIEW
|
curl "${1}" | open -f -a $PREVIEW
|
||||||
}
|
}
|
||||||
|
|
||||||
pri ()
|
function pri ()
|
||||||
{
|
{
|
||||||
about 'display information about Ruby classes, modules, or methods, in Preview'
|
about 'display information about Ruby classes, modules, or methods, in Preview'
|
||||||
param '1: Ruby method, module, or class'
|
param '1: Ruby method, module, or class'
|
||||||
|
|
@ -114,14 +114,14 @@ pri ()
|
||||||
ri -T "${1}" | open -f -a $PREVIEW
|
ri -T "${1}" | open -f -a $PREVIEW
|
||||||
}
|
}
|
||||||
|
|
||||||
quiet ()
|
function quiet ()
|
||||||
{
|
{
|
||||||
about 'what *does* this do?'
|
about 'what *does* this do?'
|
||||||
group 'base'
|
group 'base'
|
||||||
$* &> /dev/null &
|
$* &> /dev/null &
|
||||||
}
|
}
|
||||||
|
|
||||||
banish-cookies ()
|
function banish-cookies ()
|
||||||
{
|
{
|
||||||
about 'redirect .adobe and .macromedia files to /dev/null'
|
about 'redirect .adobe and .macromedia files to /dev/null'
|
||||||
group 'base'
|
group 'base'
|
||||||
|
|
@ -130,7 +130,7 @@ banish-cookies ()
|
||||||
ln -s /dev/null ~/.macromedia
|
ln -s /dev/null ~/.macromedia
|
||||||
}
|
}
|
||||||
|
|
||||||
usage ()
|
function usage ()
|
||||||
{
|
{
|
||||||
about 'disk usage per directory, in Mac OS X and Linux'
|
about 'disk usage per directory, in Mac OS X and Linux'
|
||||||
param '1: directory name'
|
param '1: directory name'
|
||||||
|
|
@ -153,7 +153,7 @@ usage ()
|
||||||
|
|
||||||
if [ ! -e $BASH_IT/plugins/enabled/todo.plugin.bash ]; then
|
if [ ! -e $BASH_IT/plugins/enabled/todo.plugin.bash ]; then
|
||||||
# if user has installed todo plugin, skip this...
|
# if user has installed todo plugin, skip this...
|
||||||
t ()
|
function t ()
|
||||||
{
|
{
|
||||||
about 'one thing todo'
|
about 'one thing todo'
|
||||||
param 'if not set, display todo item'
|
param 'if not set, display todo item'
|
||||||
|
|
@ -166,7 +166,7 @@ if [ ! -e $BASH_IT/plugins/enabled/todo.plugin.bash ]; then
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
command_exists ()
|
function command_exists ()
|
||||||
{
|
{
|
||||||
about 'checks for existence of a command'
|
about 'checks for existence of a command'
|
||||||
param '1: command to check'
|
param '1: command to check'
|
||||||
|
|
@ -203,7 +203,7 @@ mkiso ()
|
||||||
}
|
}
|
||||||
|
|
||||||
# useful for administrators and configs
|
# useful for administrators and configs
|
||||||
buf ()
|
function buf ()
|
||||||
{
|
{
|
||||||
about 'back up file with timestamp'
|
about 'back up file with timestamp'
|
||||||
param 'filename'
|
param 'filename'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue