LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 01-19-2005, 01:00 PM   #1
yaBoy
LQ Newbie
 
Registered: May 2004
Posts: 22

Rep: Reputation: 15
Linux equivalent script


for /f %%i in (stations.txt) do (
copy c:\temp\file.txt \\%%i\c$\temp
)

Where stations.txt is a text file with
station1
station2
station3
...
 
Old 01-19-2005, 01:11 PM   #2
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Re: Linux equivalent script

Quote:
Originally posted by yaBoy
for /f %%i in (stations.txt) do (
copy c:\temp\file.txt \\%%i\c$\temp
)

Where stations.txt is a text file with
station1
station2
station3
...
Just to clarify everyone, it appears that the actual question here is "I have written this script in a programming language that I don't care to explain and would like to know what I would need to do to it to have it run under Linux. Please tell me in roughly the same way so I can copy and paste it".

yaBoy - if you want help from our members, at least try to look as if you care that people will have to spend their time doing this. What have you tried so far?
 
Old 01-19-2005, 01:22 PM   #3
yaBoy
LQ Newbie
 
Registered: May 2004
Posts: 22

Original Poster
Rep: Reputation: 15
My apologies! XavierP is correct. Thanks. The original script is a generic batch file used on Windows machines to copy files from one station to a list of machines in stations.txt. The basics of the script is for each machine in stations.txt copy file.txt to that machines temp folder.

I was really looking for responses on using the CLI to access other machines. Such as copying files.
 
Old 01-21-2005, 08:30 PM   #4
kvedaa
Member
 
Registered: Mar 2004
Location: Virginia
Distribution: PacketProtector
Posts: 331

Rep: Reputation: 30
well that depends. I do similar things in a fully linux enviorment on a regular basis. But before I go further I want to a take a moment to expalin that I have set up my boxes to communicate via ssh, including tools such as scp (secure copy), where I have established my keys on the boxes in question and have set up ssh-agent to handle authentication, so that I do not need to enter my password for every box. Using a bash it might look something like this...

Code:
#!/bin/bash

# here I am defining the file that I will be getting
# the names or ip address for the computers that
# I want to run through the loop
 
ips='cat ./stations.txt` 


# this is the base of the loop, for every entery in 
# the aforementioned set, it will be run through
# the loop

for ip in $ips
do 

     scp /temp/file.txt yourusername@$ip:/temp/

done
I hope that this helps shed some light on the subject...
 
  


Reply



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] Linux equivalent to Win98 ctkroeker Linux - Distributions 23 09-08-2005 05:32 PM
Websense Equivalent for Linux? dumbsheep Linux - Software 2 04-14-2005 02:09 PM
Linux Equivalent of MSN. rvijay Linux - General 6 10-29-2004 01:20 PM
slackware's /etc/rc.d/rc.firewall equivalent ||| firewall script startup win32sux Debian 1 03-06-2004 09:15 PM
Linux Scandisk equivalent. xode Linux - Software 7 11-06-2003 06:12 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 12:32 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