LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 01-07-2007, 11:22 AM   #1
cyjetsu
LQ Newbie
 
Registered: Jan 2007
Posts: 3

Rep: Reputation: 0
newbie's script ideas


I am a linux newbie. I have ideas for scripts and would like some constructive input on how practical they seem to more experienced users.
First I am thinking of making some basic scripts to retrieve information, ie: If I have loads of text files about... say people(each file about 1 person) with "age:xx" and "name:xx" on different lines(1 field per line) and I want a script to retrieve various data relative to input:
Run script, then as prompted enter age >20, and script gives me the names of all people older than 20 and writes the names to a txt file and sends somewhere to print it.
I know there are database programs that can do this. But I think using a terminal, script and text files would be much quicker, as it only processes exactly what is needed as I run the script. I also use text files a lot so I can use them everywhere without having to install software setup for the right os etc, plus the fact that they are small and tidy. I also believe some limitations of programmed software does not apply to scripts, as If I wanted to create user accounts based on the script I just detailed I could add another section to the script to create accounts based on the names it retrieves, where as a database program would not be programmed to do this because software is only designed to do specific tasks, and correct me if I am wrong, using scripts you can do quite a multitude of different functions?

Another more complicated script I was thinking of was to backup data. I work on different computers to do different things, but I use the same files on all of them so when I actually get around to networking them I would like to make a script that automatically updates the other machines when I modify a file on one of them, say computer A, I add/modify some files, a script could check dates or existence of file, and if computers B and C are out of date, the script would automatically copy the new/modified file to those machines. And I could make the script run automatically every hour so I do not have to even worry about it. This would save me having to write down the files I modified every time I do so before manually backing up.

These sound like a great ideas to me but being a newbie I wonder if I am missing some obvious realities?
So your thoughts are welcome. If you think something is a good idea or a stupid idea, explain your reasons.
Thanyou
Nick
 
Old 01-07-2007, 11:28 AM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
For writing scripts, there are lots of tutorials on the net. Use google to find them.
O'Reilly do a really good book "Classic Shell Scrpiting", which beats all the net tutorials, but it's $35.

For backing up like you suggest, please take a look at the rsync command.
And welcome to LQ!
 
Old 01-07-2007, 11:34 AM   #3
cyjetsu
LQ Newbie
 
Registered: Jan 2007
Posts: 3

Original Poster
Rep: Reputation: 0
I would like input on how practical the functionality of my script ideas are, relative to efficiency I suppose.

Not how to actually write the scripts.
Saying that, some actual programming pointers would be helpful. Book adverts, not so helpful.

However I will look into that rsync command....
Thanks for replying.
Input on practicality anyone?
 
Old 01-07-2007, 11:45 AM   #4
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Ubuntu, FreeBSD
Posts: 1,449

Rep: Reputation: 48
These are fairly practical... not very hard if you know what you're doing.
 
Old 01-07-2007, 01:21 PM   #5
cyjetsu
LQ Newbie
 
Registered: Jan 2007
Posts: 3

Original Poster
Rep: Reputation: 0
Good. They did sound very practical to me. Guess I was being paranoid.
I think I can manage the scripts, the hard part is sorting out networking my computers first. Then I can have fun with scripting.
 
  


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
LXer: Ten ideas about Ideas LXer Syndicated Linux News 0 11-05-2006 09:21 AM
Ok so my script is not working, any ideas? mago Linux - General 8 03-31-2005 12:13 AM
sed script help/ideas rjcrews Programming 2 07-30-2004 03:59 PM
shell script ideas marigb Linux - Newbie 8 04-24-2004 03:16 AM
ideas for a perl script LAMP_User Programming 3 03-18-2004 05:18 PM


All times are GMT -5. The time now is 08:26 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