2

Current scenario: I am trying to run Unix shell script from a Solaris 5.10 box, within the script one of the tasks is to ssh to another Linux host (ssh-key pair already setup) and run a set of commands.

Problem: While the script runs fine,all the commands that were run in the remote box were not showing up properly in my Solaris terminal. I've used set -x to show all the steps the script is doing. All the remote steps for some reason start printing in the middle of my screen and sometimes if the commands ran on remote server were long it won't show me the full command its running. I have the widest monitor and my terminal width is not an issue. Is there compatibility issue with default terminal widths between my Solaris and Linux boxes ?? Hope my problem is clear.

  • Perhaps the TERMinal types aren't in sync? Sounds like the remote script is using some control characters that your local terminal isn't translating the same way. Can you post sample output and the value of $TERM on both sides? – Jeff Schaller Feb 9 '16 at 1:13
  • 1
    echo $TERM xterm on both local Solaris and remote system Linux systems – ayrton_senna Feb 9 '16 at 18:32
2

Running across a network connection, sometimes (in particular when permissions change, e.g., using sudo), the terminal size information is not propagated to the remote machine. When that happens, of course, some programs become confused about when to format their output, wrapping lines, etc.,

You can usually use the resize program to ask the terminal its width, and fix that. You would run that on the remote machine, and it would send escape characters to ask the terminal its size, and then it would update the remote machine's idea of the actual size.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.