INPUT/OUTPUT question


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting INPUT/OUTPUT question
# 1  
Old 10-09-2013
Code INPUT/OUTPUT question

Hi All,

Is it wrong to do something like this:
Code:
ssh -T $PROXY_USER@$PROXY_SERVER < script.txt > ssh_output.log

I ran and it works fine and does what I need. I wanted to pass a set of commands to the ssh session and store an output in the log file.

Thanks

Last edited by vbe; 10-09-2013 at 05:53 PM..
# 2  
Old 10-09-2013
It's ok.
This User Gave Thanks to cjcox For This Post:
# 3  
Old 10-09-2013
Might want to log stderr as well:
Code:
ssh -T $PROXY_USER@$PROXY_SERVER < script.txt > ssh_output.log 2> ssh_error.log

or
Code:
ssh -T $PROXY_USER@$PROXY_SERVER < script.txt > ssh_output.log 2>&1

This User Gave Thanks to Chubler_XL For This Post:
# 4  
Old 10-09-2013
Since you're redirecting, you probably don't need the -T at all. The -T option is useful if you want a semi-interactive session, but without a pseudo-tty... in other words something that is more like (in layman terms) talking to a line printer (sort of).

It can be an evil option in that you get something that is somewhat interactive but doesn't leave as much of a 'trail" with regards to things like wtmp, etc.. I only mention this because tricks like this are possible using rsh (remote shell) as well. In case somebody may be thinking differently.
# 5  
Old 10-10-2013
Quote:
Originally Posted by Chubler_XL
Might want to log stderr as well:
Code:
ssh -T $PROXY_USER@$PROXY_SERVER < script.txt > ssh_output.log 2> ssh_error.log

or
Code:
ssh -T $PROXY_USER@$PROXY_SERVER < script.txt > ssh_output.log 2>&1

Thanks, I was actually thinking about how to handle ssh errors in this case.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Input/output error

Hi issue with red hat and san. I had a LUN shared to me from an oracle storage I am able to see it and the size. ~]# multipath -ll mpathe (3600144f0e984617b00005b466bd70014) dm-3 SUN,ZFS Storage 7430 size=10T features='0' hwhandler='0' wp=rw |-+- policy='round-robin 0' prio=1... (0 Replies)
Discussion started by: goya
0 Replies

2. UNIX for Beginners Questions & Answers

Looping through input/output

Hi, I've got a directory of about 6000 txt files that look like this: a b c d e f g h k l m n I need to execute a command on them to combine them and, in the end, have one big file with all the needed columns taken form all the 6000 files. I've got the "combining" program, but my problem... (26 Replies)
Discussion started by: zajtat
26 Replies

3. UNIX for Dummies Questions & Answers

Filtering output from given input

Hi All, I have a input file as below. Input file may contain more hostlists. sample Input file $ cat hostlist.lst cs18-db1-1-sjl cs22-db1-1-was na88-db1-1-chi na21-db1-2-was I want the output like below format. Pls help. Thanks ! Output format: ... (4 Replies)
Discussion started by: kamauv234
4 Replies

4. Shell Programming and Scripting

Take the input from output logs

Hi, If I have loads of logs like below and I am interested to print the requests(lines) which have taken more than 1000 ms. In this case how could I print the two highlighted lines ? abc.log reqquest id232342 , adfghfasdfsaf, TIME=30 reqquest id11111 , asdfdfghdffsaf, TIME=54 reqquest... (4 Replies)
Discussion started by: nariwithu
4 Replies

5. Shell Programming and Scripting

Take the input from output logs

Hi, If I have loads of logs like below and I am interested to print the requests(lines) which have taken more than 1000 ms. In this case how could I print the two highlighted lines ? abc.log reqquest id232342 , adfghfasdfsaf, TIME=30 reqquest id11111 , asdfdfghdffsaf, TIME=54 reqquest... (0 Replies)
Discussion started by: nariwithu
0 Replies

6. Shell Programming and Scripting

Dynamic output file generation using a input text file with predefined output format

Hi, I have two files , one file with data file with attributes that need to be sent to another file to generate a predefined format. Example: File.txt AP|{SSHA}VEEg42CNCghUnGhCVg== APVG3|{SSHA}XK|"password" AP3|{SSHA}XK|"This is test" .... etc --------- test.sh has... (1 Reply)
Discussion started by: hudson03051nh
1 Replies

7. Shell Programming and Scripting

input -output file

Hi, I am having an Input file .which is having a list of names. comapring with our database , needs to write the out put in file called output.txt , format should be name--> country--->phone number could you please help me.. thanks in advance (7 Replies)
Discussion started by: hegdeshashi
7 Replies

8. UNIX for Advanced & Expert Users

input/Output settings

How can we view all the input/output settings of unix environment for a session (6 Replies)
Discussion started by: paritoshc
6 Replies

9. Shell Programming and Scripting

Using output to input another command

Hi guys. Is it possible (I'm sure it is) to use the output of a simple 'ls' command as input of another command 'tail'. It is not really the output of the 'ls'. I have to useeach line of the output. This is the first command... ls *myFile*021308* Which it outputs many filenames. For each... (3 Replies)
Discussion started by: rodrimuino
3 Replies

10. Red Hat

kickstart output/input

Hello Linux gurus! Ive got a RedHat EnterP. 4 kickstart server that is also running RedHat EnterP 4. It is working as i should and no problem at all. However, now i want to run a little script with output and input. Ive read up a bit and what i realized is that a input in %pre phase is not a... (3 Replies)
Discussion started by: maskot
3 Replies
Login or Register to Ask a Question