Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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!
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.