LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to write shell script (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-write-shell-script-4175556776/)

boby.kumar 10-21-2015 07:01 AM

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

rtmistler 10-21-2015 07:25 AM

Quote:

Originally Posted by boby.kumar (Post 5437957)
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.

Kenbryton 10-21-2015 08:51 PM

deleted


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