Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to write code inside ssh block in shell? Post 302499294 by Yagami on Thursday 24th of February 2011 01:14:26 AM
Old 02-24-2011
Hi,

Sorry but I am not able to understand the hint provided by you, can you please elaborate?

Thx.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

FTP inside a block of code

I need help on the code below. I am getting a compile error syntax error at line 283 : `<<' unmatched Looks like it doesn't like the << on the ftp line below. If I ran the code outside of this block everything work fine, but when I put in a block of code or in a function, I got syntax error. I... (1 Reply)
Discussion started by: leemjesse
1 Replies

2. Shell Programming and Scripting

looping a array inside inside ssh is not working, pls help

set -A arr a1 a2 a3 a4 # START ssh -xq $Server1 -l $Username /usr/bin/ksh <<-EOS integer j=0 for loop in ${arr} do printf "array - ${arr}\n" (( j = j + 1 )) j=`expr j+1` done EOS # END ========= this is not giving me correct output. I... (5 Replies)
Discussion started by: reldb
5 Replies

3. Shell Programming and Scripting

ssh inside a for loop

Hi, The requirement is to ssh to unix servers and oracle databases, to perform some monitoring activity. I'm using shell script to perfom this. I pass the server details and database to a variable ... SERVERS="SERVER1 SERVER2 SERVER3" DATABASE="DB1 DB2 DB3" for i in $SERVERS do ssh... (2 Replies)
Discussion started by: senthil3d
2 Replies

4. Shell Programming and Scripting

variables inside an ssh session

Hello all, I would like to declare and use variables inside an ssh session. I have the feeling that it's not possible. Here is the situtation simpified: #:/bin/sh test="salut" echo $test ssh hudson@10.41.21.99 <<EOF export testssh="salut" echo testssh=$testssh ... (4 Replies)
Discussion started by: Lotfus
4 Replies

5. Shell Programming and Scripting

Using ssh command inside a script

Hi, I have a script file in server A. Inside the script file, I first have a ssh command that will connect to a remote server B. In the same script file itself, I have a sequence of commands that has to be run in server B. I am embedding these commands in the script file that I have in server A.... (2 Replies)
Discussion started by: mick_000
2 Replies

6. Shell Programming and Scripting

Write Awk output to a file , inside script.

Hi, Can anyone please help me with this issue. I have a Awk command which take file as input, and provides the output having multiple lines, its working in command mode, but not if i plug it in script. #!/bin/ksh infile=a.txt outfile=b.txt awk ' BEGIN{ FS=OFS="|";ORS = "\n";... (1 Reply)
Discussion started by: sp999
1 Replies

7. Shell Programming and Scripting

Executing multiple ssh commands inside a shell simultaneously

I would like to execute a commands in four different servers through ssh at a single instance(simultaneously). Below are the details with examples, ssh user1@server1 "grep xxxx logs" ssh user1@server2 "grep xxxx logs" ssh user1@server3 "grep xxxx logs" Each statement will take some... (4 Replies)
Discussion started by: Amutha
4 Replies

8. AIX

Need help on for loop inside ssh

Hi, I am having a file like, #cat file Jun 19 13:08 Jun 19 13:08 Jun 19 13:08 Jun 19 13:14 when I run the below comamnd locally it will work fine, IFS=$'\n'; for i in $(cat file) ;do echo "HI $i" ; done And the output is, HI Jun 19 13:08 HI Jun 19 13:08 HI Jun 19 13:08 HI... (1 Reply)
Discussion started by: sumanthupar
1 Replies

9. UNIX for Beginners Questions & Answers

How to have local shell variables in a ksh script seen on remove server in SSH block?

I have googled this and found many solutions, but none of them are working for me. I am in a korn shell, most others reference bsh, maybe that is the issue? Anyway, all I am trying to do is use a variable I have declared in my main script in a remote shell I am running through ssh. So I have a... (8 Replies)
Discussion started by: DJR
8 Replies

10. UNIX for Beginners Questions & Answers

How to write a Boolean variable which succeed and failed inside the if loop in shell script ?

I have if loop with multiple variable value check in if loop. How can i print only if loop satisfied variable and its value in shell script ? I dont want to check each variable in if loop. That makes my script larger. if ] then echo "Only satisfied variable with value" ... (3 Replies)
Discussion started by: prince1987
3 Replies
POSIX_FADVISE(2)					      BSD System Calls Manual						  POSIX_FADVISE(2)

NAME
posix_fadvise -- hint at the future access pattern of a file LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <sys/fcntl.h> int posix_fadvise(int fd, off_t offset, off_t size, int hint); DESCRIPTION
posix_fadvise() hints at the application's access pattern to the file and range given by the file descriptor, fd, and offset and size. If size is zero, it means to the end of file. hint should be one of the followings. POSIX_FADV_NORMAL No hint. (default) POSIX_FADV_RANDOM Random access. POSIX_FADV_SEQUENTIAL Sequential access. (from lower offset to higher offset.) POSIX_FADV_WILLNEED Will be accessed. POSIX_FADV_DONTNEED Will not be accessed. POSIX_FADV_NOREUSE Will be accessed just once. Calling posix_fadvise() doesn't alter the semantics of the operations, it is only a matter of performance. RETURN VALUES
On success, posix_fadvise() returns 0. Otherwise, it returns an error number. SEE ALSO
errno(2), madvise(2) BUGS
For POSIX_FADV_NORMAL, POSIX_FADV_RANDOM, and POSIX_FADV_SEQUENTIAL, the current implementation ignores offset and size, and applies the hint to the whole file. BSD
June 9, 2009 BSD
All times are GMT -4. The time now is 07:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy