bash - Redirect output of a file to the write command -


i trying redirect standard outupt of file write command , display contents of file (with color changes) in terminal of other user.

the contents of file output displayed (filename menu_sys.sh)

echo -e "\t\t\033[4;41m welcome internal messaging system \033[0;0m"

when use code $ sh menu_sys.sh | write 680613 output ^[[4;41m welcome internal messaging system^[[0;0m

tried using standard output redirection using &1> did not work

but need output in formatted condition.

if write command allowed arbitrary control characters sent terminal of user, flagrant security problem. in fact, sanitizes contents of message sent render control characters harmless. that's why see esc control character 2 ascii characters '^' , '[' on other user's terminal.

as aside: jonathan leffler mentioned, "standard output of file" doesn't make sense. appear doing sending standard output of command (echo) write command, not "standard output of file". or if meant send contents of file other user (using command write 680613 < somefile) ok too.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -