LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Closed Thread
  Search this Thread
Old 03-31-2011, 07:12 PM   #1
dnoy
Member
 
Registered: Nov 2007
Posts: 69

Rep: Reputation: 15
script


All,

can someone please help me with something very basic. I have one script that goes through some IPs:


###############################3
#/usr/bin/sh
# This is a script to copy files from one host to a group of h osts


# $3 = third paramter (file that contains list of hosts)


HOSTFILE="list.txt"

#Im trying to do a loop that will go through every ip in the list.txt file
for host in $HOSTFILE
do
#need to figure out how to pass the variable to the expect script
/scripts/expect.sh
done
################################################

#this is a seperate script called expect.sh
#!/usr/bin/expect
#need to get variable here
spawn ssh test@$IP
expect "Password:"
send "test\r"
expect "#"
send "mkdir /test\r"
expect "#"


##################################################

thank you in advance
 
Old 04-01-2011, 12:03 PM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
Do not post in 2 forums as it is considered poor form and against LQ rules.
 
Old 04-01-2011, 12:10 PM   #3
dnoy
Member
 
Registered: Nov 2007
Posts: 69

Original Poster
Rep: Reputation: 15
thanks, im trying to delete this one as i placed it in the wrong forum but dont know how.
 
Old 04-01-2011, 04:53 PM   #4
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by dnoy View Post
thanks, im trying to delete this one as i placed it in the wrong forum but dont know how.
Report your own thread (the one that you want 'deleted'), and a mod will sort it out for you. In fact, threads very rarely get deleted, but just closed off.
 
Old 04-03-2011, 03:44 PM   #5
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
This thread is closed. Please post all replies to http://www.linuxquestions.org/questi...t-help-872418/
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Script question: create a shell script in kde to log in on a server with ssh c4719929 Linux - Newbie 1 01-31-2011 03:05 AM
Need help with script to organise files into folders as part of DVD backup script jasybee2000 Linux - Newbie 5 06-15-2009 07:29 PM
How to get full path to script file inside script itself? And in case of sym links? maggus Linux - Newbie 3 05-28-2009 08:40 AM
send automatic input to a script called by another script in bash programming jorgecab Programming 2 04-01-2004 12:20 AM
linux 9 and java script error - premature end of script header sibil Linux - Newbie 0 01-06-2004 04:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration