General
cancel
Showing results for 
Search instead for 
Did you mean: 

Two question force logout and copy from buffer

SOLVED
Go to solution
Alexo
Advisor

Two question force logout and copy from buffer

Hi Everyone
1- sometime when I copy every text or command from terminal and paste it in for example notepad it work but sometimes not work!!

2- I use below command for force logout an user from server but when I copy this command to other terminal , not work??

ps -u username | while read a b c^Jdo^Jkill -9 $a^Jdone

thank you

3 REPLIES
Dennis Handly
Acclaimed Contributor

Re: Two questions force logout and copy from buffer

>1 sometime when I copy every text or command from terminal and paste it in notepad sometimes not work

 

This is more of a Windows issue, nothing to do with HP-UX.  What doesn't work?

 

>2 I use below command for force logout an user from server but when I copy this command to other terminal, not work?

ps -u username | while read PID b c; do kill -9 $PID; done

 

In general you should never first use kill -9.  You should do a normal kill first.

What doesn't work, the copy or the kill script fragment?

Alexo
Advisor

Re: Two question force logout and copy from buffer

thank you for your answer

in 1 case i connect to the server by windows software and in the new enviroment i can load a xterminal of hp-ux
.i am not in hp-ux directly.but i access to hp-ux by terminal.and copy from terminal somtimes work!!

in 2 case i dont want to one by one proccess i want the user has been  force logout.this command work when i load that from history (ESc and /) but when i type or copy that it doesn't work.

Highlighted
Dennis Handly
Acclaimed Contributor
Solution

Re: Two questions force logout and copy from buffer

>I am not in HP-UX directly but I access to HP-UX by terminal and copy from terminal sometimes work

 

I use putty and don't have problems with cut&paste between it and Windows.

 

>in 2 case I don't want to one by one process... This command works when I load that from history (Esc and /) but when I type or copy that it doesn't work.

 

Instead of typing newlines, use semicolons as I had above:

ps -u username | while read PID b c; do kill -9 $PID; done

 

Or better yet, put it in a script.