Xshell Forum

Quick Command : Paste the text file

Last post: Friday, November 16, 2012 1:59 PM by Rednroll, 5 reply

 
Tuesday, December 6, 2011 2:07 AM - NewUser

Quick Command : Paste the text file

 
I assign a quick command button to a text file with multiple lines of commands. I got another one blank line after each line of command. But when I tried copying commands from a text file and paste them manually, there is no problem. Does Xshell append CR on every line in the text file ? Please advise.

Program Ver. : Xshell 4
Tuesday, December 6, 2011 10:07 PM - Support

Re: Quick Command : Paste the text file

 
Xshell sends everything in the text file exactly as it is saved in the file.

Could you send us the file you are having problem with? And also, please explain the problem in little more detail.

Thank you for your cooperation.


---
Technical Support
Wednesday, December 7, 2011 5:53 AM - NewUser

Re: Quick Command : Paste the text file

 
I attach a sample of text file. When I run it, I will get another blank line after the output of each command like below.

$ pwd
output of pwd
$
$ date
output of date
$
$ who
output of who
$
$ whoami
output of whoami
$

But if i open the file and copy manually and paste into a shell, it would be normal like this.

$ pwd
output of pwd
$ date
output of date
$ who
output of who
$ whoami
output of whoami

More info :
1) Properties -> Terminal -> Advanced -> "Receive LF as CR +LF" is not checked
2) I notice when edit Quick Command, in "Send the following text:" there is option to Append CR (after the text) but in "Past the content of the following text file:", it does not have option to append CR but it seems to append CR automatically at the end of each line.
Wednesday, December 7, 2011 6:44 PM - Support

Re: Quick Command : Paste the text file

 
Thank you for the information.

This problem occurs due to EOL (end of line) difference in Windows and UNIX. Windows recognizes CR&LF as EOL and returns to new line. In UNIX, CR and LF are both considered new line characters.

When sending these commands with copy&paste, CR (carriage return) & LF (line feed) is converted to UNIX format, CR. But, with Quick Button, the content is sent without reformatting.

I will request a feature to convert CR&LF to CR when sending text contents.

Please feel free to leave your thoughts on this feature.

---
Technical Support
Wednesday, December 7, 2011 7:28 PM - NewUser

Re: Quick Command : Paste the text file

 
Thank you. I will look forward to this feature. So I can do more with Quick Command.

In my opinion, you may add option for user to choose between Unix text file or Windows text file. Or automatic detection/conversion would be great.
Friday, November 16, 2012 1:59 PM - Rednroll

Re: Quick Command : Paste the text file

 
I just ran into this same problem using Xshell 4 (Build 0120) and did not notice anything to work around this problem yet.

For anyone else that may run into this problem using Windows, here's what I ended up doing.

Instead of using standard Notepad in Windows, use Notepad++ and do the following within Notepad++.
1. Goto the FORMAT menu and select "Convert to UNIX Format"

Then select to Save as "Normal Text File".