osx - Passing readable punctuated text through ssh commands in macOS? -


i need "say" things people shell , set alias , automatically escapes punctuation marks.

i have alias that's working great, except questions, commas, etc.:

 tell_someone='ssh -e none username@hostname say' 

but when run tell_someone "can hear me?", returns:

zsh:1: no matches found: me? 

while tell_someone "can hear me\?" works fine. i'd make work , without quotes if possible, need escape punctuation.

can simple alias job or need resort writing script handle in more robust manner?

note: rationale work wears headphones , have multiple monitors , it's impossible attention have restore more covert means used in computer lab in college pranks on sun systems used play audio @ people... :)

try using function instead of alias (don't worry; feels same alias, handles arguments in more flexible way):

tell_someone () { printf "%q" "$*" | ssh -x -e none someone@host } 

adjust per needs.


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -