Sponsored Content
Full Discussion: Remote while IFS
Top Forums Shell Programming and Scripting Remote while IFS Post 302913711 by rbatte1 on Tuesday 19th of August 2014 12:48:52 PM
Old 08-19-2014
I think what you have done here is to execute the command /sbin/sysctl -a in your script before calling the ssh to run this on the remote server.

Try this (untested) adjustment:-
Code:
#!/bin/ksh

#HOST="$(/bin/hostname)"
HOST="server1"
KPARMS="\$(/sbin/sysctl -a)"
OUTFILE=/var/tmp/sysctl.txt

ssh -B ${HOST} "while IFS= read ; do echo \"${HOST} : ${REPLY}\"; done <<< \"${KPARMS}\" > ${OUTFILE} ; cat ${OUTFILE}"

Does that help?



Robin
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

IFS variable

How can I set the value for IFS variable (2 Replies)
Discussion started by: mahabunta
2 Replies

2. Shell Programming and Scripting

problem with IFS

hi, :) I set IFS=":" But when i try to echo $IFS,i am not getting any thing on the screen escept a blank line. any help pls. cheers RRK (11 Replies)
Discussion started by: ravi raj kumar
11 Replies

3. UNIX for Dummies Questions & Answers

Help on IFS command!

Hi! I am working in korn shell. I want to reset the dimiliter for the set command to "|" but instead of a command prompt return I am getting something as below After issuing the command I am getting this....as if the shell is expecting something else. Can anybody suggest what's the problem. ... (2 Replies)
Discussion started by: udiptya
2 Replies

4. Shell Programming and Scripting

regarding IFS=

hi i am a learner can some explain "export IFS=$(echo "\n\t\a")" i am not able to understand the functionality please help thanks Satya (1 Reply)
Discussion started by: Satyak
1 Replies

5. Shell Programming and Scripting

while loop with 3 ifs

im messing up somehwere...and can't seem to clean up the script...for it to work objectives: 1. check for today's file, and sleep 30 secs between retries 2. only allow 5 tries before script should fail. 3. if today's file found, wait 30 seconds for it to process.. code: count=0... (8 Replies)
Discussion started by: sigh2010
8 Replies

6. Shell Programming and Scripting

read and IFS

Hi, This is out of curiosity: I wanted to extract year, month and date from a variable, and thought that combining read and IFS would help, but this doesn't work: echo "2010 10 12" | read y m d I could extract the parts of the date when separated by a -, and setting IFS in a subshell: ... (3 Replies)
Discussion started by: raphinou
3 Replies

7. Shell Programming and Scripting

How to use IFS in this scenario?

Given the scenario like this, if at all if have to use IFS on the below given example, how it should be used. IFS=/ eg: /xyz/123/348/file1 I want to use the last slash /file1 . So can anyone, suggest me how to pick the last "/" as a IFS. (4 Replies)
Discussion started by: raghunsi
4 Replies

8. Shell Programming and Scripting

While loop and IFS?

Hi, while ; do echo "Please enter " read enter yyyy=${enter:0:4} mm=${enter:5:2} dd=${enter:8:2} result=`validateDate $yyyy $mm $dd` When does the loop keeping repeating till?? till 1 is equal to 1? what does this mean "${enter:0:4}" .The 0 and 4 part?? ... (3 Replies)
Discussion started by: sid22
3 Replies

9. Shell Programming and Scripting

Nested ifs

hi I keep getting an error with this nested if statement and am getting the error unexpected end of file, can anyone help me as to why this wont execute? #!/bin/bash #script to check wether the -i -v statements run correctly removeFile () { mv $1 $HOME/deleted }... (3 Replies)
Discussion started by: somersetdan
3 Replies

10. Shell Programming and Scripting

Bash IFS

I am using bash and resetting IFS as below when reading the command line arguments. I do this so I can call my script as in Ex1. Ex1: ./synt2d-ray3dmod.bash --xsrc=12/20/30 This allows me to split both sides so that when I do "shift" I can get 12/20/30 What I do not understand is... (21 Replies)
Discussion started by: kristinu
21 Replies
SSS_SSH_KNOWNHOSTSPR(1) 					 SSSD Manual pages					   SSS_SSH_KNOWNHOSTSPR(1)

NAME
sss_ssh_knownhostsproxy - get OpenSSH host keys SYNOPSIS
sss_ssh_knownhostsproxy [options] HOST [PROXY_COMMAND] DESCRIPTION
sss_ssh_knownhostsproxy acquires SSH host public keys for host HOST, stores them in a custom OpenSSH known_hosts file (see the "SSH_KNOWN_HOSTS FILE FORMAT" section of sshd(8) for more information) /var/lib/sss/pubconf/known_hosts and estabilishes connection to the host. If PROXY_COMMAND is specified, it is used to create the connection to the host instead of opening a socket. ssh(1) can be configured to use sss_ssh_knownhostsproxy for host key authentication by using the following directives for ssh(1) configuration: ProxyCommand /usr/bin/sss_ssh_knownhostsproxy -p %p %h GlobalKnownHostsFile2 /var/lib/sss/pubconf/known_hosts This is an experimental feature, please use http://fedorahosted.org/sssd to report any issues. OPTIONS
-p,--port PORT Use port PORT to connect to the host. By default, port 22 is used. -d,--domain DOMAIN Search for host public keys in SSSD domain DOMAIN. -h,--help Display help message and exit. SEE ALSO
ssh(8), ssh_config(5), sss_ssh_authorizedkeys(1). AUTHORS
The SSSD upstream - http://fedorahosted.org/sssd SSSD
03/04/2013 SSS_SSH_KNOWNHOSTSPR(1)
All times are GMT -4. The time now is 03:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy