URL: https://linuxfr.org/forums/programmation-shell/posts/scp-lit-bashrc Title: scp lit .bashrc...? Authors: kowalsky Date: 2005年12月28日T10:24:07+01:00 Tags: Score: 0 j'ai ecri un petit script, pour exporter la variable DISPLAY à chaque ssh: #Declare automatique DISPLAY CONS=$(tty | sed "s~/dev/~~g") ATIP=$(who | grep $CONS | awk '{print 6ドル}' | sed "s~(~~g" | sed "s~)~~g" | sed "s~::ffff:~~g" ) echo "DISPLAY=$ATIP:0" export DISPLAY=$ATIP:0 unset CONS unset ATIP Je l'ai mise sur la machine distante, un solaris. Quand, depuis ma machine locale je fais: scp kowalsky@192.168.0.124:/etc/hosts /etc/hosts j'ai un retour du type: grep: can't open protocol error: bad mode You have mail in /var/mail/root [kowalsky@~/test]# a grep: can't open tty Et quand j'enleve .bashrc, je n'ai aucun probleme, j'en conclu que scp lit .bashrc. J'ai trouvé un autre moyen d'exporter la variable DISPLAY, grace à la variable TERM, mais comment resoudre ce probleme sans tricher avec la variable TERM...?