vagrant - How do I call a shell function and pass it to ssh? -


so,

echo 'echo hi;echo hello' |  vagrant ssh slave3 

works fine. does,

cat scr.sh |  vagrant ssh slave3 

but want have function contents can pass on vm. like:

echo functionname |  vagrant ssh slave3  

it says

-bash: line 1: functionname: command not found 

i tried

functionname|vagrant ssh slave3  

with contents of function:

fn() {     echo hi } 

but

-bash: line 1: hi: command not found 


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -