System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Executing long commands on secureCRT terminal

 
SOLVED
Go to solution
Shivkumar
Super Advisor

Executing long commands on secureCRT terminal

Hello,

I have some commands syntax which are very long having 4-5 lines. I use secureCRT to connect HP-UX Servers.
I have noticed when i copy paste using mouse continuity between lines breaks.

What settings do i need to change so that i can copy and paste entire lines from notepad or word to secureCRT terminal without breaking lines ?

Thanks,
Shiv
4 REPLIES
Bill Hassell
Honored Contributor
Solution

Re: Executing long commands on secureCRT terminal

You didn't mention what program you are using on HP-UX so I will assume vi. vi can break up lines at the right margin (or not) depending on the setting for wm. Use this command to turn off margin wrap.

:wrapmargin=0

You can also just use cat to paste into a file:

cat > some_file_name

(then paste -- no prompt, press CTRL-d to finish)


Bill Hassell, sysadmin
Matti_Kurkela
Honored Contributor

Re: Executing long commands on secureCRT terminal

The best way would be to use a single backslash at the end of the lines to indicate that the command continues on the next line:

command /this/is \
/a/very/long/list \
/of/arguments \
/for/the/command

The shell will automatically recognize this and will display a special prompt for the extra lines:

$ command /this/is \
> /a/very/long/list \
> /of/arguments \
> /for/the/command

The (backslash + linefeed) combination will act as a space in the command line. If you need long strings without spaces, this might not help.

The second way to solve this problem concerns the application you're copying the command line from (i.e. Word or Notepad). If it understands the command is a single long line, it will be pasted as a single long line, even if the program displays it on multiple lines. Word should be able to do this, but Notepad might not (because Notepad's line wrapping might be too primitive).

The third way would be to write a small HP-UX script. You could use environment variables to pack the arguments more tightly:

#!/bin/sh
A="/this/is"
B="/a/very/long/list"
C="/of/arguments"
D="/for/the/command"

command $A $B $C $D

or if the arguments must form a single long line, then:

#!/bin/sh
A="/this/is/"
B="/a/very/long/"
C="/single/argument/"
D="/for/the/command"

command $A$B$C$D

There are probably many other ways to solve this problem. To find the ideal way, we would have to know more about the command you're trying to run.

MK
MK
Steven Schweda
Honored Contributor

Re: Executing long commands on secureCRT terminal

> What settings do i need to change so that i
> can copy and paste entire lines from
> notepad or word to secureCRT terminal
> without breaking lines ?

To me, that sounds like a question about
applications running on a Windows system, not
really anything to do with HP-UX.

With my weak psychic powers, I can't really
see what's in these Notepad or Word
documents, or what you're trying to
copy+paste from where into what, how. If
there are line breaks in the text you're
copying, then you might expect them to get
pasted into the destination.
Dennis Handly
Acclaimed Contributor

Re: Executing long commands on secureCRT terminal

>MK: The (backslash + linefeed) combination will act as a space in the command line.

No, a real shell will just remove the backslash and linefeed. No spaces added.
$ echo abc\
> def
abcdef