You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
at first: Thank you for this awesome framework.
It is may a stupid and annoying question but I don't find a solution so far.
I like to transfer my bash scripts into a plugin to cleanup my ~/bin/ directorey and move all scripts into plugins.
The structure is likely as:
#!/bin/bash
# some definitions
ini=$(readlink "$0").ini
some paths
some other definitions
# functions
function getini(){
strH="`awk /"$myHost"/ $ini`";
nameS=`echo $strH | cut -d" " -f 1`
hostS=`echo $strH | cut -d" " -f 2`
userS=`echo $strH | cut -d" " -f 3`
portS=`echo $strH | cut -d" " -f 4`
keyS=`echo $strH | cut -d" " -f 5`
tcpS=`echo $strH | cut -d" " -f 6`
i=$hostS
getstate
}
function howto(){
the code
}
and so on...
while getopts H:caestmvbdou opt
do
case $opt in
H) myHost=$OPTARG;;
b) mkbackup;;
c) connect;;
a) addhost;;
e) $EDITOR $ini;;
s) machinestatus;;
t) dothetest;;
m) mountsshfs;;
v) verbo="-vvv";;
d) getdesktop;;
o) colors;;
u) unmountsshfs;;
?) howto;;
esac
done
I know the shebang is not transferrable ;-)
For a shell script, I call a it by name when it's in my '$PATH' and add the options and may parameters. At a OMZ plugin, each funtion is availlable by itself in the terminal.
Can I prevent this availability with e.g. a "nested" structure or similar? And in that case can I combine more than one script with options within one plugin?
Can I still use my code in the same way as the shell script?
If 1. and 2. is positive, can I place the ini file in the plugin directory for the use with the plugin?
Thank you in advance for your support and patience.
Cheers Tino
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello folks,
at first: Thank you for this awesome framework.
It is may a stupid and annoying question but I don't find a solution so far.
I like to transfer my bash scripts into a plugin to cleanup my ~/bin/ directorey and move all scripts into plugins.
The structure is likely as:
I know the shebang is not transferrable ;-)
For a shell script, I call a it by name when it's in my '$PATH' and add the options and may parameters. At a OMZ plugin, each funtion is availlable by itself in the terminal.
Thank you in advance for your support and patience.
Cheers Tino
Beta Was this translation helpful? Give feedback.
All reactions