Two question force logout and copy from buffer (328 Views)
Reply
Advisor
Alexo
Posts: 15
Registered: ‎02-22-2014
Message 1 of 4 (328 Views)
Accepted Solution

Two question force logout and copy from buffer

[ Edited ]

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

Acclaimed Contributor
Dennis Handly
Posts: 25,277
Registered: ‎03-06-2006
Message 2 of 4 (299 Views)

Re: Two questions force logout and copy from buffer

[ Edited ]

>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?

Advisor
Alexo
Posts: 15
Registered: ‎02-22-2014
Message 3 of 4 (292 Views)

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.

Acclaimed Contributor
Dennis Handly
Posts: 25,277
Registered: ‎03-06-2006
Message 4 of 4 (286 Views)

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.

 

 

 

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.