Sponsored Content
Top Forums Shell Programming and Scripting While loop breaking when using "ssh" command inside Post 302894977 by sumitsks on Friday 28th of March 2014 07:15:00 AM
Old 03-28-2014
Try this
Code:
FILELIST=$(ssh -n $SOURCE_SERVER_NAME find $SOURCE_FOLDER_NAME -type f -mtime +$ARCHIVE_DELAY < /dev/null | grep "$SOURCE_FOLDER_NAME/$LOAD_FILE_NAME" )

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Breaking input with "read" command

In this post, Perderabo's script says echo 05/06/25 14:15:56 | IFS=" /:" read Y1 M1 D1 h1 m1 s1 which, if I am not wrong, will break the input into Y1, M1 et al. I tried the following in my code #! /bin/ksh # per.sh typeset -R2 HOUR=00 typeset -R2 MIN=00 typeset -R2 SEC=00 ... (2 Replies)
Discussion started by: vino
2 Replies

2. Shell Programming and Scripting

Need a Command To display "echo command value in loop" in single line.

Hi I want to display "echo command value in loop" in single line. My requirement is to show the input file (test_1.txt) like the output file (test_2.txt) given below. Input file :test_1.txt a1|b1|4|5 a1|b1|42|9 a2|b2|32|25 a1|b1|2|5 a3|b3|4|8 a2|b2|14|6 Output file:test_2.txt... (2 Replies)
Discussion started by: sakthifire
2 Replies

3. Shell Programming and Scripting

Breaking "while read" also breaks the parent process

Hi, I'm a bit confused. Maybe some master can explain to me what is happening. I have a program that starts issuing output about himself loading. I want to run it in another thread but I want to wait untill it's fully loaded. Program sample: $ cat myprogram echo "loading" echo "almost... (3 Replies)
Discussion started by: chebarbudo
3 Replies

4. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

5. Shell Programming and Scripting

How to increment date using "for loop" in format MMDDYY inside the shell script?

Need to increment the date from "currentdate + 90days" inside the for loop (i=1 to i=50) (5 Replies)
Discussion started by: aroragaurav.84
5 Replies

6. UNIX for Dummies Questions & Answers

What is the significance of sh -s in ssh -qtt ${user}@${host} "sh -s "${version}"" < test.sh?

Please can you help me understand the significance of providing arguments under sh -s in > ssh -qtt ${user}@${host} "sh -s "${version}"" < test.sh (4 Replies)
Discussion started by: Sree10
4 Replies

7. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

8. Shell Programming and Scripting

Bash - How to do a "read -p" inside a while loop?

Hi there guys! I was trying to do: while read line; do if ; then read -p "Press Enter to continue..." cont=0 fi echo $line let cont++ done < file.txt However, I have read that the read -p would not work in a while loop... I was wondering if there is any other way to... (2 Replies)
Discussion started by: rplae
2 Replies

9. Shell Programming and Scripting

Failure: if grep "$Var" "$line" inside while read line loop

Hi everybody, I am new at Unix/Bourne shell scripting and with my youngest experiences, I will not become very old with it :o My code: #!/bin/sh set -e set -u export IFS= optl="Optl" LOCSTORCLI="/opt/lsi/storcli/storcli" ($LOCSTORCLI /c0 /vall show | grep RAID | cut -d " "... (5 Replies)
Discussion started by: Subsonic66
5 Replies

10. UNIX for Beginners Questions & Answers

"Mv" command does not work in loop, but works manually

Hi there, this may be a beginner's error, but I've been unable to find a solution on my own and by googling, and now I am really stuck on it. I am simply trying to move directories called for example CAT_Run01.ica to a directory with the corresponding number, Run01, in the same directory. For... (2 Replies)
Discussion started by: andrevol
2 Replies
KNIFE-SSH(1)							    Chef Manual 						      KNIFE-SSH(1)

NAME
knife-ssh - Run a command or interactive session on multiple remote hosts SYNOPSIS
knife ssh QUERY COMMAND (options) -a, --attribute ATTR The attribute to use for opening the connection - default is fqdn -C, --concurrency NUM The number of concurrent connections -m, --manual-list QUERY is a space separated list of servers -P, --ssh-password PASSWORD The ssh password -x, --ssh-user USERNAME The ssh username -i, --identity-file IDENTITY_FILE The SSH identity file used for authentication -p, --ssh-port PORT The ssh port --[no-]host-key-verify Verify host key, enabled by default. DESCRIPTION
The ssh sub-command opens an ssh session to each of the nodes in the search results of the QUERY. This sub-command requires that the net-ssh-multi and highline Ruby libraries are installed. On Debian systems, these are the libnet-ssh-multi-ruby and libhighline-ruby pack- ages. They can also be installed as RubyGems (net-ssh-multi and highline, respectively). TERMINAL MULTIPLEXING AND TERMINAL TAB SUPPORT
knife ssh integrates with several terminal multiplexer programs to provide a more convenient means of managing multiple ssh sessions. When the COMMAND option matches one of these, knife ssh will create multiple interactive ssh sessions running locally in the terminal multi- plexer instead of invoking the command on the remote host. The available multiplexers are: interactive A built-in multiplexer. interactive supports running commands on a subset of the connected hosts in parallel screen(1) Runs ssh interactively inside screen. ~/.screenrc will be sourced if it exists. tmux(1) Runs ssh interactively inside tmux. macterm (Mac OS X only) Opens a Terminal.app window and creates a tab for each ssh session. You must install the rb-appscript gem before you can use this option. SEE ALSO
knife-search(1) AUTHOR
Chef was written by Adam Jacob adam@opscode.com with many contributions from the community. DOCUMENTATION
This manual page was written by Joshua Timberman joshua@opscode.com. Permission is granted to copy, distribute and / or modify this docu- ment under the terms of the Apache 2.0 License. CHEF
Knife is distributed with Chef. http://wiki.opscode.com/display/chef/Home Chef 10.12.0 June 2012 KNIFE-SSH(1)
All times are GMT -4. The time now is 07:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy