I like scripts

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
ricardezra

I like scripts

Post by ricardezra »

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
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Pilosopong Tasyo
Level 6
Level 6
Posts: 1432
Joined: Mon Jun 22, 2009 3:26 am
Location: Philippines

Re: I like scripts

Post by Pilosopong Tasyo »

There is a Manuals and Guides thread in this section of the forum. You might want to peruse that thread.
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].
ricardezra

Re: I like scripts

Post by ricardezra »

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.
DrHu

Re: I like scripts

Post by DrHu »

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
ricardezra

Re: I like scripts

Post by ricardezra »

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!
Habitual

Re: I like scripts

Post by Habitual »

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.
ricardezra

Re: I like scripts

Post by ricardezra »

ok thanks
User avatar
Pilosopong Tasyo
Level 6
Level 6
Posts: 1432
Joined: Mon Jun 22, 2009 3:26 am
Location: Philippines

Re: I like scripts

Post by Pilosopong Tasyo »

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.
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].
Locked

Return to “Scripts & Bash”