LinuxQuestions.org
Help answer threads with 0 replies.
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 05-22-2013, 03:55 AM   #1
Tareq9959
LQ Newbie
 
Registered: May 2013
Posts: 6

Rep: Reputation: Disabled
Lightbulb 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
 
Old 05-22-2013, 03:59 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,863

Rep: Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905Reputation: 2905
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...
 
Old 05-22-2013, 03:59 AM   #3
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,574

Rep: Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929
Here is a good resource:http://www.tldp.org/guides.html and look for the Advanced Bash-Scripting Guide
 
Old 05-22-2013, 05:46 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
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
 
Old 05-22-2013, 07:16 AM   #5
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
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.
 
1 members found this post helpful.
Old 05-22-2013, 09:14 AM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 5,936
Blog Entries: 12

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
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.
 
1 members found this post helpful.
Old 05-22-2013, 10:39 AM   #7
kooru
Senior Member
 
Registered: Sep 2012
Posts: 1,385

Rep: Reputation: 273Reputation: 273Reputation: 273
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
 
  


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] bash and xterm: how make apps started by and for a script persist when script terminates porphyry5 Linux - General 4 06-15-2011 02:27 PM
[SOLVED] How to make a bash script keep running in same terminal after it calls second script? JohnRock Linux - Newbie 4 06-25-2010 10:16 AM
script executed inside another script dont make changes potraike Linux - Newbie 4 03-05-2008 06:27 AM
How do I make a simple script and make it run on bootup?? coolblue Programming 5 12-18-2006 10:55 PM
can i make a script or program make a phone call? nephish Linux - Software 2 08-15-2005 10:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:29 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration