Sponsored Content
Top Forums Shell Programming and Scripting Issues for script that login to a unix box Post 302654965 by neutronscott on Tuesday 12th of June 2012 01:33:19 PM
Old 06-12-2012
Well I meant to quote it... To show how one usually wants to send a script to stdin on remote host. Usually one does want the parameter expansion done on the remote host. You'd otherwise need to be more careful. Ideally you'd replace the ls with a more appropriate function. Without knowing what's in /builds it's hard to guess. But seeing that he's splitting at / and printing the last two, I'd expect something like:

Code:
/builds/foo/app123
/builds/bar/app456

or maybe its
Code:
/builds/build.1234/app
/builds/build.5678/app

But anyway, in regards to passing a script the a remote host, I'd start with something like this:

Code:
#!/bin/bash
read -p 'Build number: ' buildNumber
ssh mute@localhost sh -s "$buildNumber" <<'EOF'
cd /builds
ls -lrt ./*/* | awk -F\/ '/\//{print $(NF-1) $NF }' | grep "$1"
EOF

but the real issue is what is the structure of the directory so we can avoid parsing ls and having false matches and such.
 

9 More Discussions You Might Find Interesting

1. AIX

Vi opens automatically when i login to a unix box

When I login to a unix box using a putty session , I'm landed in a vi editor, instead of my home directory,I'm guessing instead of pointing me to my home directory, the system points me to /usr/bin/vi. As a result, everytime I log into the system I open up a vi editor and am in there. how do i... (3 Replies)
Discussion started by: ramky79
3 Replies

2. Shell Programming and Scripting

calling a unix script in one box from another box

i have a unix script which is available in a box say box1 i want this script to be run in box box2 and put the output file in box2 what is the procedure to execute this script in box2 i will call the script in box1 using cybermation (1 Reply)
Discussion started by: trichyselva
1 Replies

3. UNIX for Dummies Questions & Answers

Running UNIX commands remotely in Windows box from Unix box – avoid entering password

I am able to run the UNIX commands in a Windows box from a UNIX box through "SSH" functionality. But whenever the SSH connection is established between UNIX and Windows, password for windows box is being asked. Is there a way to avoid asking password whenever the SSH connection is made? Can I... (1 Reply)
Discussion started by: D.kalpana
1 Replies

4. Shell Programming and Scripting

how to use ssh-keygen to login to a UNIX box

I have to login with ssh to a UNIX box and execute a script in it. How will i make use of ssh-keygen so that while login using ssh it wont ask the passwod. ssh-copy-id is not working in my UNIX box . What might be the reason. Please help. (1 Reply)
Discussion started by: codeman007
1 Replies

5. Shell Programming and Scripting

ftp file starting with particular name on Windows box to Unix box using shell script

Hello all ! I'm trying to write a shell script (bash) to ftp a file starting with particular name like "Latest_" that is present on a Windows box to UNIX server. Basically I want to set this script in the cron so that daily the new build that is posted on the Windows box can be downloaded to the... (2 Replies)
Discussion started by: vijayb4u83
2 Replies

6. Linux

How to find remote Linux box login account without login in to that box?

Hi, How to find remote Linux box login account without login in to that box? I don't have login account at my remote Linux box. But I need who are all having login account. How do I findout? Thanks, --Muthu. (3 Replies)
Discussion started by: Muthuselvan
3 Replies

7. UNIX for Dummies Questions & Answers

DNS on Unix box issues

Hi Guys, Just wanted to seek your assistance on an issue encountered with one of our client DNS server query. we have 2 sets of DNS servers.. internal and external. For Internal to reach the external DNS server (DMZ) it has to go through 2 FWs. Current settings: - FW rules for Internal... (3 Replies)
Discussion started by: Hotshot8259
3 Replies

8. Linux

Linux script for multiple box login.

Hello! We currently use a SecureCRT .vbs script which automates logging into multiple boxes to run a few commands. However, I'd like to have something run in Linux vs. our emulator. Below is my objective :): Our current .vbs script will look at an IP list .txt file on our PC, then login to... (1 Reply)
Discussion started by: birdboyee
1 Replies

9. Programming

Remote login UNIX box from java passing parameters to the custom script called in the profile

Hello Good Day / Guten Tag.... I have to login the server and the user profile contains some scripts which need the inputs to be taken from the keyboard. So I use the method to conn.authenticateWithKeyboardInteractive(username, new InteractiveCallback() { public String... (1 Reply)
Discussion started by: Sanalkumaran
1 Replies
build-lives-rfx-plugin-multi(1) 			      General Commands Manual				   build-lives-rfx-plugin-multi(1)

NAME
build-lives-rfx-plugin-multi - builds rendered effects for LiVES SYNOPSIS
build-lives-rfx-plugin-multi type [scripts_dir exec_dir] [build_bindir] DESCRIPTION
This perl script builds rendered effects (RFX) plugins for LiVES. If scripts_dir is not defined then type is used to locate the plugin scripts directory and output directory. Type can be builtin (the default), custom, test, or builtinx. The type builtinx forces scripts_dir and exec_dir to be read from parameters and is used during LiVES install, and is the only type which should be used if scripts_dir is specified. Each plugin script in input directory is scanned to find its language code. The script is then passed to the script compiler for that lan- guage. The directory location of the script_compiler may be specified by the build_bindir parameter (as is the case during LiVES installa- tion0; otherwise the user's $PATH will be searched. Return values the script returns the following values 0 - success 1 - the "type" parameter was not defined, or set to an invalid value 3 - the builder for a plugin script was not found SEE ALSO
build-lives-rfx-plugin(1), lives(1) AUTHOR
Gabriel Finch a.k.a Salsaman (salsaman@xs4all.nl) May 9 2010 build-lives-rfx-plugin-multi(1)
All times are GMT -4. The time now is 08:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy