Discussion:
running a bash function from with in tmux.
Sinbad
2015-04-29 13:36:30 UTC
Permalink
Hi,

I have a user defined bash function which takes one string parameter
and does some operation on that string. i want to be able to call this
function from with-in tmux and also pass the parameter from tmux
itself. how can i achieve that ?

thanks
Sinbad
2015-04-30 01:36:57 UTC
Permalink
can anyone shed some light on this.
Post by Sinbad
Hi,
I have a user defined bash function which takes one string parameter
and does some operation on that string. i want to be able to call this
function from with-in tmux and also pass the parameter from tmux
itself. how can i achieve that ?
thanks
Nicholas Marriott
2015-04-30 07:11:40 UTC
Permalink
Put it in a shell script and run that?
Post by Sinbad
can anyone shed some light on this.
Hi,
I have a user defined bash function which takes one string parameter
and does some operation on that string. i want to be able to call this**
function from with-in tmux and also pass the parameter from tmux
itself. how can i achieve that ?
thanks
References
Visible links
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
tmux-users mailing list
https://lists.sourceforge.net/lists/listinfo/tmux-users
Marcel Partap
2015-05-03 12:09:33 UTC
Permalink
Post by Sinbad
I have a user defined bash function which takes one string parameter
and does some operation on that string. i want to be able to call this
function from with-in tmux and also pass the parameter from tmux
itself. how can i achieve that ?
You can invoke bash with a command sequence that sources your alias,
Post by Sinbad
bind-key T new-window -c "#{pane_current_path}" "bash -c 'source /etc/bash/bash_aliases; tress -f'"
tress is a function (display directory tree + size in pager)
tress ()
{
[ ! -e "$1" ] && par=$1 && shift || par=;
cat <(tree -hDC --dirsfirst --timefmt '%F' $par "$dir"|sed -r 's/([^.])\.\//\1/') <(du -sh "$dir") | less -SR
}
Also useful to read specific (or all) environment profile variables. You
Post by Sinbad
bind-key m command-prompt -p "man:" "split-window -c '#{pane_current_path}' -p 90 'source /etc/profile.d/less-termcaps.sh && LESS=\"-SRiMJj.2~ --shift 5\" man %% || read -n1'"
export LESS_TERMCAP_us=$(tput smul; tput setaf 5) # underline start: underline, magenta
export LESS_TERMCAP_ue=$(tput rmul; tput sgr0) # underline end: norm
export LESS_TERMCAP_so=$(tput bold; tput rev; tput setaf 2; tput setab 0) # standout mode start: bright green, reverse
export LESS_TERMCAP_se=$(tput rmso; tput sgr0) # standout mode end: reset
export LESS_TERMCAP_mb=$(tput bold; tput setaf 5) # blinking start: bold, magenta
export LESS_TERMCAP_md=$(tput bold; tput setaf 6) # bold mode start: bold, cyan
export LESS_TERMCAP_me=$(tput sgr0) # mode end: reset
export LESS_TERMCAP_mr=$(tput rev)
export LESS_TERMCAP_mh=$(tput dim; tput setab 5)
export LESS_TERMCAP_ZN=$(tput ssubm)
export LESS_TERMCAP_ZV=$(tput rsubm)
export LESS_TERMCAP_ZO=$(tput ssupm)
export LESS_TERMCAP_ZW=$(tput rsupm)
export LESS_TERMCAP_ZZ=$(tput sgr0) # reset: do not litter 'env' output
Loading...