1836648 Members
1994 Online
110102 Solutions
New Discussion

Re: output from commands

 
kamal_15
Regular Advisor

output from commands

hi all

i have ph-ux version 10.20

when i xecute a command like ll (as example).

i can redirect the output to file as :
******
ll>f1
******

is there any way to redirect this output to
another PC(running Windows).

to be more clear.

i can write script that and make it run every 1 houre.

i want to receive the output from this script in my PC(Windows).

is there any way to do that?

thank you


14 REPLIES 14
Slawomir Gora
Honored Contributor

Re: output from commands

Hi,

There is no simple command to do this but
I think that you can for example do:
1. If yoy have configured mail system you can
send output via mail
ll | mail adres@a.b.c
2. You can redirect command output to file and every hour copy by runnning rcp or scp or ftp from PC.

KapilRaj
Honored Contributor

Re: output from commands

There are many but diffrent options ..

01. Use sendmail to send it across as an email . So that u can recieve it an windows.
02. Install samba server so that you can map one directory from unix server on ur windows box. write the log onto this directory ..

Regds,

Kaps
Nothing is impossible
kamal_15
Regular Advisor

Re: output from commands

thank u for response

but is there way accros network?
KapilRaj
Honored Contributor

Re: output from commands

i think both the options can be over network

Kaps
Nothing is impossible
kamal_15
Regular Advisor

Re: output from commands

I mean if i want to make application
inteact with windows client / server.

cliet (Windows)send request
server (HP-UX) response

what i need ?

i have a good knowledge with programming languages.

KapilRaj
Honored Contributor

Re: output from commands

Why don't you write a program that willl listen on the unix server to a request that is coming from windows ...

Kaps
Nothing is impossible
kamal_15
Regular Advisor

Re: output from commands

i can do it with visual basic on windows
but i don't know how on unix

can u tell me from where i start?
Biswajit Tripathy
Honored Contributor

Re: output from commands

I believe the best solution for you would be emailing
the script output as suggested by someone else.
Another easy solution would be to enable ftp server
on the PC and have the script in HP-UX box
automatically ftp this to PC.

If you want to take this oppertunity to learn network
programming on Unix, then you should be looking at
the "UNIX Network Programming" by W Richard
Stevens. The following URL has a link to the source
code of all the example in the book that you can
reuse.

- Biswajit
:-)
Biswajit Tripathy
Honored Contributor

Re: output from commands

Oops...here is the URL:

http://www.kohala.com/start/unpv12e.html

- Biswajit
:-)
kamal_15
Regular Advisor

Re: output from commands

many thankx for your help

i already made ftp partition on my pc

and now i can send files from unix to my PC.

when i try to write script as :

****************************
ftp IP_address user user_name account paaswd
****************************

it make error

is there way to write a parameter for login
in script and run it? without
ftp prompt appear?

thankx
KapilRaj
Honored Contributor

Re: output from commands

ftp -n << END
open $1
user $2 $3
prompt off
bin
put $4
quit
END

From unix to windows

Kaps
Nothing is impossible
kamal_15
Regular Advisor

Re: output from commands

realy
that is i want
many thankx


but can you explain the meaning of <
and i write the script as :
***********************
ftp -n << END
open IP_address
user user passwd
put f1
bye
***********************
and run ok
why you use prompt off? (or that was explain to me)?

thank you

Nguyen Anh Tien
Honored Contributor

Re: output from commands

HI Kamal.
This script must be

***********************
ftp -n << END
open IP_address
user user passwd
put f1
bye
END
***********************
END is mark point. It likes "begin" and "end" in VB. It is used for identify where is first ftp command and last ftp command.
NOTE: Using ftp is smarter than mail. but you must install FTP server on PC (recommand IIS).
HTH
HP is simple
Nguyen Anh Tien
Honored Contributor

Re: output from commands

By default ftp started in interactive mode.
For example.
ftp> mput *
mput 51434s.pdf?
If you want your script auto pass this step you must set
ftp>prompt off
NOTE: IF YOU PUT OR GET BINARY FILE YOU MUST SET FTP TRANFER IN BINARY MODE BY TYPING:
ftp>bin
so that full script are:
#############################
ftp -n << END
open IP_address
user user passwd
prompt off
bin
put f1
bye
END
###########################
HP is simple