LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-21-2015, 08:01 AM   #1
boby.kumar
Member
 
Registered: Mar 2013
Posts: 92

Rep: Reputation: Disabled
How to write shell script


Hi,
I am planning to write a shell script for the below operation:
1. Login to remote webserver via ssh and get the latest log file and copy that log file to local machine.
2. login to another remote machine via ssh and run some commands and capture the output of command and get that outfile to localmachine.
3. and From local machine copy both files to remote windows machine.

Can anyone write the scripts for the same ?

Thanks in Advance
 
Old 10-21-2015, 08:25 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,087
Blog Entries: 10

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
Quote:
Originally Posted by boby.kumar View Post
Can anyone write the scripts for the same ?
Certainly people have the ability to write plenty of scripts on their own. What you should be doing here is attempting to write this script on your own first and when you get stuck, post your attempt in this thread indicating where you've run into problems.

You have a pretty good description of the tasks. My favorite saying is that "anything you can do on the command line, you can write in a script".

You should choose a scripting language. BASH is one of them, but there are others. As far as BASH goes, there are links in my signature to the BASH guides for beginners, advanced programmers, and also my own BASH blog which includes a number of tips for writing BASH scripts.

A further recommendation is that you consider asking a moderator to move this thread to the Non-Nix -> Programming forum, or the Linux -> Software forum, so as to get better exposure for your question. I personally recommend the Programming one, there are tons of script questions which come up on that forum.

Please do not write a duplicate thread, the correct thing to do is to request that your thread be moved by using the Report button on the screen. I know that sounds counter-intuitive, but that is how LQ works.

You don't have to request the thread be moved, just a minor suggestion.

The best thing to do is start your script and post what you have.
 
Old 10-21-2015, 09:51 PM   #3
Kenbryton
LQ Newbie
 
Registered: Oct 2015
Posts: 4

Rep: Reputation: Disabled
deleted

Last edited by Kenbryton; 10-22-2015 at 02:03 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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] can i write a shell script in /etc/init.d that will run a python script? lapishater276 Debian 1 06-27-2014 04:23 PM
SHELL SCRIPT Write at the right of the shell window solo9300 Linux - General 3 09-29-2009 05:56 PM
How to ssh from a shell script ? For ppl who can write shell scripts. thefountainhead100 Programming 14 10-22-2008 07:24 AM
[SHELL SCRIPT] Write at the right of the shell window Creak Linux - General 2 04-02-2004 04:00 PM


All times are GMT -5. The time now is 04:38 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration