LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to make script (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-make-script-4175462970/)

Tareq9959 05-22-2013 02:55 AM

how to make script
 
hi..

in fact i am new in Linux OS so i want make script for daily check using this command, (df -k,top ,ps -ef|grep tomact)

so guys i need your support in this task ...

Thank Q

pan64 05-22-2013 02:59 AM

in general a script is a list of commands (executed one by one). So if you have a group of commands just put them in a file and the script is ready to run.
Otherwise please give us more details...

TenTenths 05-22-2013 02:59 AM

Here is a good resource:http://www.tldp.org/guides.html and look for the Advanced Bash-Scripting Guide

chrism01 05-22-2013 04:46 AM

See also http://rute.2038bug.com/index.html.gz

We like to help people, rather than do it for them.

Use the links you've been given to have a go, then come back if you get stuck.
Don't forget to post your code if you do come back

shivaa 05-22-2013 06:16 AM

If you're complete newbie in scripting, then follow guides suggested in above posts #3 and #4.

On the other hand, if you have little bit knowledge of scripting, then begin as:
Code:

#!/bin/bash
command1
command2
command3
..
..
commandn
exit 0

However, before suggesting anything more, let's know what you've done so far and where are you stuck.

rtmistler 05-22-2013 08:14 AM

Please post a script that you've started with any questions that have arisen, if any. You may find that the script works once you try it.

Recommendations are that you enable some bash debugging options to assist you in your debugging.

http://tldp.org/LDP/Bash-Beginners-G...ect_02_03.html

Reading that whole guide will be helpful.

Another tip is to pay attention to special bash variables and consider functions for complicated scripts.

kooru 05-22-2013 09:39 AM

Study and exercises ;)
A good thing is try to resolve a same problem with different way.
Anyway as already said, tldp is a good resource: http://www.tldp.org/guides.html


All times are GMT -5. The time now is 09:02 AM.