LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-20-2003, 07:04 AM   #1
zhanglinbao
LQ Newbie
 
Registered: Jul 2003
Posts: 1

Rep: Reputation: 0
hello people ,I am a learner about shell scripts ,I find it very hard to learn .


I don't know if you can give a advise to teach me to study Shell Scripts .Thank you !
if you can tell a good web site about shell script learning ,I will be appriciation of you !
 
Old 07-20-2003, 07:58 AM   #2
MooktaKiNG
Member
 
Registered: Feb 2003
Location: London, UK
Distribution: Gentoo/Debian
Posts: 39

Rep: Reputation: 15
Here start with Bash scripting. There are like hundreds of howto's on the internet here's one:
http://www.tldp.org/LDP/abs/html/index.html
 
Old 07-20-2003, 10:44 AM   #3
jackyopensrc
LQ Newbie
 
Registered: Jul 2003
Location: Kuala Lumpur,Malaysia.
Distribution: Red Hat 7.3
Posts: 16

Rep: Reputation: 0
It's rather easy than High-Level Programming Languages.

1) save this code
#!/bin/bash
echo "Hello,Bash !"

2) type "chmod a+x " filename
3) run the filename
4)Just this simple
 
Old 07-20-2003, 12:04 PM   #4
2damncommon
Senior Member
 
Registered: Feb 2003
Location: Calif, USA
Distribution: PCLINUXOS
Posts: 2,918

Rep: Reputation: 103Reputation: 103
Shell scripts at their simplest are just a series of bash commands.
They need to have the #!/bin/bash line and be made executable as jackyopensrc mentions.
Try something simple like a script that mounts your floppy, lists the contents, then unmounts it. Next time you have 3 unlabeled floppies you can see what's on them with one command.
When you see how simple this is you just need some more ideas and a good reference.
 
Old 07-21-2003, 09:12 AM   #5
apeekaboo
Member
 
Registered: Apr 2003
Location: Stockholm/Sweden
Distribution: Kubuntu, Debian, Slax
Posts: 91

Rep: Reputation: 16
Shellscripting is often about extracting information from files and taking actions based on this, or changing text streams, or taking actions based on wether a particular command was successful or not.
Therefore you'll find it well worth to learn commands like sed, awk and grep.
The more commands you know and can use, the easier shellscripting will become.
Don't forget to use the apropos command if you're not sure what command you're looking for...

Also learn how to create loops, if statements and functions.
Arrays can be useful too, but I rarely use them in my scripts so I would give them a lower priority...
 
Old 07-21-2003, 01:30 PM   #6
lfur
Member
 
Registered: Jul 2003
Location: Slovenia
Distribution: Slackware & FreeBSD
Posts: 209

Rep: Reputation: 30
zhanglinbao,

before you go on reading Advanced Bash Scripting Guide, like MooktaKiNG suggested, you may try to take an easy intro with
BASH programming HOWTO (http://www.ibiblio.org/pub/Linux/doc...tro-HOWTO.html or you can find it on your linux box), becouse abs advances quite fast and it could be a bit confusing for a newbie (well at least it was for me ).

Enjoy
 
Old 07-22-2003, 04:06 AM   #7
jackyopensrc
LQ Newbie
 
Registered: Jul 2003
Location: Kuala Lumpur,Malaysia.
Distribution: Red Hat 7.3
Posts: 16

Rep: Reputation: 0
Good day Everybody,

You can discover that Shell scripts can be very useful sometimes.

zhanglinbao,

May I ask you some kind of questions,such as

1)What type of Documents you are refering...?
2)Which parts of it you found difficults?
3)Have you ever tried a simple program?

I think you'd better let us your situations.
 
  


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
Why do people say Debian is hard? Or for Elitist DebianBlackBird Debian 25 12-31-2005 01:42 AM
How do people learn higher level programming? microsoft/linux Programming 13 09-25-2005 10:48 AM
Why *NIX is so hard to learn PTrenholme General 7 02-28-2005 12:50 PM
Want to learn Shell Scripting dawood Linux - General 3 08-04-2004 07:59 AM
Why do people piss and moan about linux being hard to install? versaulis Linux - Software 29 10-07-2003 05:45 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:10 AM.

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
Open Source Consulting | Domain Registration