I like scripts

Forum rules
Before you post please read how to get help

I like scripts

Postby ricardezra on Tue Sep 20, 2011 2:00 am

I have been a linux mint 9 user for a year and I have a really good hang of it. after downloading themes and modifying the different scripts to make them work (sometimes) I understand how scripts work. I want to learn more can anyone point me in the right direction? I have seen the hello world stuff on google, but there is so much out there and I would like to be on the beginners road. :D
ricardezra
Level 3
Level 3
 
Posts: 131
Joined: Fri Aug 27, 2010 12:44 am

Linux Mint is funded by ads and donations.
 

Re: I like scripts

Postby Pilosopong Tasyo on Tue Sep 20, 2011 2:17 am

There is a Manuals and Guides thread in this section of the forum. You might want to peruse that thread.
Image
o Give a man a fish and he will eat for a day. Teach him how to fish and he will eat for a lifetime!
o If an issue has been fixed, please edit your first post and add the word [SOLVED].
User avatar
Pilosopong Tasyo
Level 6
Level 6
 
Posts: 1206
Joined: Mon Jun 22, 2009 3:26 am
Location: Philippines

Re: I like scripts

Postby ricardezra on Tue Sep 20, 2011 1:37 pm

I have been reading that section, but I cant find out how to get started. like can I be a super user or do I have create a new account? and if I create a new account can I still write scripts and not be a super user or what is a phython interpreter? I need the very basics to get started.
ricardezra
Level 3
Level 3
 
Posts: 131
Joined: Fri Aug 27, 2010 12:44 am

Re: I like scripts

Postby DrHu on Tue Sep 20, 2011 2:04 pm

ricardezra wrote:I have been reading that section, but I cant find out how to get started.

If you have really got the hang of it (Mint) and scripts being used, I don't understand the problem
--you must have checked already howtos for scripts; at least I hope you did rather than cut and paste selections and try them out to see what happens..
    Not a great way to learn
    --although some can muddle through using that method..

script helpers..
http://linuxhelp.blogspot.com/2005/10/1 ... shell.html
http://wiki.bash-hackers.org/scripting/tutoriallist
User avatar
DrHu
Level 17
Level 17
 
Posts: 7093
Joined: Wed Jun 17, 2009 8:20 pm

Re: I like scripts

Postby ricardezra on Tue Sep 20, 2011 3:55 pm

no the only thing I have done so far is make some scripts executable and change some script txt in conky to get different themes and make it do other things. I would like to be able to write my own scripts from scratch. I just want to know the best way to get started without writing something that would crash my whole computer or something worse!
ricardezra
Level 3
Level 3
 
Posts: 131
Joined: Fri Aug 27, 2010 12:44 am

Re: I like scripts

Postby Habitual on Tue Sep 20, 2011 6:58 pm

Here's a tip:

Use echo in front of any command you are not sure about (or all if just beginning)

Example:
Open a terminal and type
Code: Select all
mkdir scratch
cd scratch
for i in `seq 20` ; do touch $i ;done
cd ~
echo rm scratch/*


They don't actually delete, but it will show you what it would do w\out the echo:
Code: Select all
rm scratch/1 scratch/10 scratch/11 scratch/12 scratch/13 scratch/14 scratch/15 scratch/16 scratch/17 scratch/18 scratch/19 scratch/2 scratch/20 scratch/3 scratch/4 scratch/5 scratch/6 scratch/7 scratch/8 scratch/9


Nice and safe.
What's a landing but a take off in reverse?
User avatar
Habitual
Level 8
Level 8
 
Posts: 2274
Joined: Sun Nov 21, 2010 8:31 pm
Location: LM17Q-Xfce

Re: I like scripts

Postby ricardezra on Tue Sep 20, 2011 7:04 pm

ok thanks
ricardezra
Level 3
Level 3
 
Posts: 131
Joined: Fri Aug 27, 2010 12:44 am

Re: I like scripts

Postby Pilosopong Tasyo on Tue Sep 20, 2011 7:50 pm

I have been reading that section, but I cant find out how to get started.

Think of it like this: There are times when you have to perform a series of commands on a regular basis. So, instead of tediously retyping them every time you use the CLI, you put them in a file, and execute that file. Essentially, you wrote a script.

...can I be a super user or do I have create a new account? and if I create a new account can I still write scripts and not be a super user...

You can perform superuser commands as a normal user using sudo, just like you normally do on a command line. Assuming, of course, the account you are using indeed have admin rights. You don't have to create a new account just to write scripts. Having admin rights (or the lack thereof), has nothing to do with the [in]ability to write/run scripts.

...what is a phython interpreter? I need the very basics to get started.

GIYF! Please make an effort to exercise your fingers instead of relying on being spoonfed :roll: There are so many resources online.
Image
o Give a man a fish and he will eat for a day. Teach him how to fish and he will eat for a lifetime!
o If an issue has been fixed, please edit your first post and add the word [SOLVED].
User avatar
Pilosopong Tasyo
Level 6
Level 6
 
Posts: 1206
Joined: Mon Jun 22, 2009 3:26 am
Location: Philippines

Linux Mint is funded by ads and donations.
 

Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 2 guests