Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
Apple Computing Products:
macOS - Apps and Programs
need a script
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="XJ-linux" data-source="post: 1116120" data-attributes="member: 33722"><p>Assuming you have passwordless ssh set up on your systems, you could do something like:</p><p></p><p>#!/bin/ksh</p><p></p><p>for i in hostname1 hostname2 hostname3 hostname3; do</p><p>echo $i</p><p>ssh $i "mv /path/to/file/filename /path/to/file/newfilename"</p><p>done</p><p></p><p>You would need to supply your own shell (csh, ksh, bsh) value and would need your hostnames of course. Add as many hostnames as needed and seperate them with a press of the spacebar and nothing else. If you don't have passwordless ssh set up, it will still work, but you will be prompted for the password on each system login. The above script moves the original filename (you supply the name) and renames it to newname (you supply that name as well).</p></blockquote><p></p>
[QUOTE="XJ-linux, post: 1116120, member: 33722"] Assuming you have passwordless ssh set up on your systems, you could do something like: #!/bin/ksh for i in hostname1 hostname2 hostname3 hostname3; do echo $i ssh $i "mv /path/to/file/filename /path/to/file/newfilename" done You would need to supply your own shell (csh, ksh, bsh) value and would need your hostnames of course. Add as many hostnames as needed and seperate them with a press of the spacebar and nothing else. If you don't have passwordless ssh set up, it will still work, but you will be prompted for the password on each system login. The above script moves the original filename (you supply the name) and renames it to newname (you supply that name as well). [/QUOTE]
Verification
Name this item. 🍎
Post reply
Forums
Apple Computing Products:
macOS - Apps and Programs
need a script
Top