2001-09-04 -+- ray hartman -+- rayhart@spkn.quest.net -+- The "SHELL" huh ... nothing wrong with the CLI long as it reads
like a Ray Chandler short story --- but instead it spews stray-dogs-on-sterno howling complete with
code that looks like doodles from a spastic codeine addict
and punctuation marks rather than memes ... gag me there the fsck is REXX
when we really need it. Now ... what don't you understand about the failure
of Linux on-the-desktop ??? 2001-09-04 -+- Marc Cook -+- -+- Ray Hartman, you don't have to use the shell when you don't need it.
....but if you want you have a really powerful programming tool
to solve all kind of problems within seconds.
The bash is not the Linux desktop! What we still need is good and stable office applications

Very good article! 2001-09-30 -+- Dan Kegel -+- dank@kegel.com -+- Good looking article. People looking for books on the subject
might want to look at my bibliography at
http://www.kegel.com/linux/books.html 2001-09-30 -+- kwoff -+- -+- Nice, useful, get on your feet quick article.
Contrast this with the useless I-like-hearing-myself-babble
talkback above by ray hartman.

Someone who wants to do shell scripting could read this
article to start playing around, then when they read
`man bash` they might feel less overwhelmed.
2001-10-03 -+- MH -+- -+- Great article. Concise, yet clear. Better resource for beginning shell programming than most chapters in reference books I've read. MUCH better than slogging through the man pages! 2001-10-04 -+- Dan G -+- dangustafsson@linux.nu -+- Clear and concise advise. Thank you for sharing. 2001-10-04 -+- Stephen Rossiter -+- CSM3014@itcarlow.ie -+- is there programming in setting up a Linux lab a one printer 2001-10-05 -+- Muhammad Kamran Aslam Rana -+- creative28pk@yahoo.com -+- really i like Unix family, but i have a lot of problem, my first problem my monitor belongs to Older family therefor Linux not detect it, and the 2nd problem is, my modem not install, the 3rd problem is Sound card not install, therefor i turnOut towords windows,
Modem=Planet "fax/data/voice 56k PCI INTERNAL MODEM"
Sound card=YAMAHA724
AGP=Trident 9750 3d image PCI/AGP
so i am really thanks full to u if u solve my problem,
thanking U, creative28 2001-10-08 -+- harry -+- harry_sices@hotmail.com -+- great article. I am looking for a way to assign a value to a variable from
the result of a pattern search of a text file (either from grep or gawk or
a similar type of command).
Is there a way to do this with linux? Thanks 2001-10-11 -+- Thomas Lösche -+- thloesche@gmx.de -+- Hi harry,

you could solve your problem with the following comands

var=$(( grep 'pattern' file ))
or
var=`grep 'pattern' file`

cu Thomas 2001-10-17 -+- buffer_7 -+- -+- Hallo !!

Ich schreibe mal deutsch, da der Artikel auch deutsch war.
Der Artikel ist genial und hoffentlich kommen mal wieder'n paar Jungfüchse
auf den Geschmack und programmieren wieder in Shell.

A B E R !!!!!

Mit dem von Dir gezeigten Hashbang (#!/bin/sh)werden die Leute Probleme bekommen.
In fast allen Linuxdistributionen ist /bin/sh ein Link auf /bin/bash.
Somit funktioniert alles so wie von Dir vorgestellt.
Sollte jetzt aber jemand an Unix sitzen oder aus irgendeinem anderen Grund
tatsächlich eine sh starten, dann werden Ausdrücke wie ${variable} nicht aufgelöst.
da muß der Ausdruck in den von Dir vielzitierten Backticks (`) liegen.
Sonst findet keiner den Fehler, da die Shell lapidar meldet bad Substitution ${ .
Aber trotzdem ein sehr guter und kompetenter Artikel. Es macht Freude sowas zu lesen.
Weiter so mit Eurem Magazin und so tollen Artikeln.

Gruß und Kuß
buffer_7 2001-11-01 -+- nickydhruv -+- gutentag24@hotmail.com -+- Thanks for the simple and comprehensive article :)
2001-11-19 -+- nainala srinivas -+- sri_nainala@yahoo.com -+- VERY VERY EXLLENT 2001-12-09 -+- Bill Tyler -+- billtyler@hotmail.com -+- Great article, easy to understand.
Thanks 2001-12-18 -+- balu -+- -+- It is very good for the starter I learend something new from this.Thanks All 2002-01-03 -+- Arthur Jovellas -+- art@acesales.com -+- Hello, I am trying to do a "lynx -dump" from a shell script and it is hanging.
It has been a while since I have programmed and I know it's something stupid.
I have made the script executable. I just want the script to dump a site to
a file like so:

lynx -dump http://www.mysite.com > sitedump

From just a commandline it works fine but I cant seem to call it correctly from the script.

I guess I just need to know how to call binaries correctly.

Any suggestions appreciated. Please email me art@acesales.com

Thanks

Good article!

Art 2002-01-03 -+- guido -+- -+- Hi Arthur,
if it works from the command line then

lynx -dump http://www.mysite.com > sitedump

will work from the shellscript as well. However
dependent on how you run the script and what you set in the script
it will not see the same environment variables (PATH, http_proxy, no_proxy ...)
2002-01-23 -+- Andreas Gebauer -+- g.farmer@im-inter.net -+- Sehr guter Artikel , hab ihn nur kurz überflogen und sofort beschlossen ihn auszudrucken.
Gruss

Andreas 2002-02-03 -+- Atul Kansara -+- atulkansara@email.com -+- Sehr guter Artikel , hab ihn nur kurz überflogen und sofort beschlossen ihn auszudrucken.
Gruss

atul 2002-02-19 -+- Robert Agustin -+- -+- I want my password not visible when you type. I would like to know how
to code/script this. 2002-05-10 -+- z wang -+- z.p.wang@xtra.co.nz -+- very good artical. I enjoy it very much and it helps me a lot.
thanks!
z wang -+- 203.96.111.202 = Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; ZFREECD1; H010818) 2002-05-12 -+- Nir Soffer -+- nirs<at>mac.com -+- Very good article, thanks. -+- 192.114.157.112 = Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:1.0rc2) Gecko/20020510 2002-05-21 -+- Juan Pablo Feria -+- feria@killspammersslowly.tpitic.com.mx -+- Great Article..

Congratulations from Mexico!

-+- 148.233.136.210 = Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020326 2002-06-08 -+- sundar -+- sun2379@lycos.com -+- Hey guys iam workin on solaris(new to solaris) as well as in vax environ.. if anybody have any information bout shell prog/kernel prog, plz help me where i can find more documents and infos.. this site was usefull to me and couple of links from this page helped me find info on basic shell prog.. so thanx in advance...
bye. -+- 203.199.236.106 = Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt) 2002-07-22 -+- Ganapathi -+- gsn_msst@lycos.com -+- I got a over all basic idea about the shell programming using
the site.Thax and bye. -+- 192.193.196.7 = Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt) 2002-07-25 -+- Innocent Azinyue -+- azinyue@yahoo.com -+- Actually I have a question... When I try running the script, I get some stupid errors
For instance when I do

if [$# -lt 3]; then

# is being recongnized as a commented line. Why is that ?!?

thanks -+- 208.253.203.162 = Mozilla/4.75 [en] (X11; U; SunOS 5.8 sun4u) 2002-07-26 -+- guido socher -+- -+- Hello "Innocent Azinyue",

Space matters! Try
if [ $# -lt 3 ]; then
instead of
if [$# -lt 3]; then

Read also the part on "Control structures" in the article
there this is mentioned. -+- 217.185.243.158 = Opera/6.02 (Linux 2.4.17 i586; U) [en] 2002-08-04 -+- siva basava k -+- -+- Very good article . Very useful for beginers. -+- 144.16.67.8 = Mozilla/4.77 [en] (X11; U; Linux 2.2.19-6.2.16 i686) 2002-08-07 -+- critter -+- critter(at)parks.lv -+- Wonderful page! Very useful. Good examples and short ant reasonable explanations!

Thanx! -+- 213.175.79.36 = Mozilla/4.0 (compatible; MSIE 5.5; Windows 95) 2002-08-13 -+- Harshad -+- hnl_me@yahoo.com -+- It's very much useful things for the new user for unix. You have done well I learnt many things from your web-site for the unix.
But, still I have some confusion about the Kernel. What is kernel ? and I also want some more shell script examples. So I can clear myself.

Thank You very much..

Reply Soon. -+- 203.163.156.178 = Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) 2002-08-25 -+- Running shell commands form a script -+- jagannathasuta@hotmail.com -+- I would like to konw why a command like PS1='$PWD $' will not run in a shell script. All of my other commands run fine. -+- 162.112.18.107 = Mozilla/4.0 (compatible; MSIE 5.01; Windows NT) 2003-01-14 -+- Jose Manuel Robelto -+- jrobelto@telecom.net.co -+- Sr:

many thanks for this articule, i find all here, i learn many new thing about unix here...

my mail is jrobelto@telecom.net.co -+- 200.21.240.35 = Mozilla/4.76 [en] (Win98; U) 2003-02-07 -+- B Wheat -+- dr_b_2groovy@yahoo.com -+- I really enjoyed your article, though becase I'm still very much a newbie I would like a lot af help thanks -+- 207.150.30.172 = Mozilla/5.0 (compatible; Konqueror/3.0.0-10; Linux) 2003-04-21 -+- Ashwani -+- desperado1306@yahoo.co.in -+- Very helpful article with nice attempt to make fndamentals of Shell programming clear, I learned greta deal from this .... thanks to both the authors! -+- 202.141.69.2 = Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 2003-04-28 -+- Anju -+- anju.aggarwal@scicmp.com -+- hi,
A very useful article indeed
I am a beginer in the Unix field. I tried to run the script to convert from binary to decimal. My problem is that the command 'echo -n $1 |wc -c ' running fine on command line but giving erronous result when run thro' script. Can any of you help me in finding the solution to this strange behaviour . thanx in advance
-+- 203.200.79.34 = Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt) 2003-05-01 -+- oguzhan ceylan -+- sopho24@yahoo.co.uk -+- thanks for all article. It worked very hard for me....:) -+- 193.140.150.186 = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705) 2003-06-18 -+- Biplab Chattopadhyay -+- biplab_1979@cdotb.ernet.in -+- Mostly such small tutorial sort of things I read, will start from very basic them suddenly will jump to such complexity that I will be puzzeled and I will have to refer to some book to get that. But here the good thing I found was that the transition I could not feel. Its good one.. -+- 202.174.129.11 = Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 2003-09-15 -+- chh -+- darkavenger@163.com -+- I like the examples in this great article!

Thanks!
-+- 211.86.59.60 = Mozilla/4.8C-SGI [en] (X11; U; IRIX64 6.5 IP30) 2003-11-10 -+- sanjeev kumar -+- san_007@rediffmail.com -+- hello sir
please u tells me about the all shells in details -+- 164.100.200.26 = Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; digit_may2002) 2004-01-23 -+- jigisha -+- j_maruti@yahoo.com -+- How to create multiple users at a time by shell programming. -+- 220.224.7.57 = Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) 2004-03-31 -+- reshma -+- -+- very good article..!! for beginners -+- 131.170.90.3 = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322) 2004-06-10 -+- Chandrashekhar -+- rush_to_shekhar@indiatimes.com -+- Please guide me i want to master shell programming -+- 210.210.59.212 = Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; (R1 1.1)) 2004-06-16 -+- Koneru -+- pkoneru@aquila.com -+- Can I use the if statement as shown below to check if the files
with names beginning with jnlupload are existing ??

if [[ -f $PS_DATAHOME/glr1140_20/jnlupload* ]]; then

Thanks. -+- 205.142.237.129 = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322) 2004-07-01 -+- Paul C -+- -+- Thanks for the article. Very well written with good examples. -+- 203.219.252.30 = Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040207 Firefox/0.8 2004-07-03 -+- devaraju -+- deva_1002@sify.com -+- unix shell programming
+examples -+- 202.54.139.195 = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) 2004-07-07 -+- loius -+- loius_757@hotmail.com -+- I want ask you one question??
Question:how to write the shell script move *.html to *html.old??? -+- 202.75.152.33 = Mozilla/4.0 (compatible; MSIE 5.5; Windows 95) 2004-07-15 -+- thomas -+- tzz33v@yahoo.com -+- This is very useful for those (like me) who are beginners in shell scripting. -+- 192.124.127.228 = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 (emach0202) 2004-07-27 -+- Albert J Reily -+- -+- Great work. Keep it up! -+- 194.140.11.78 = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322) 2004-08-03 -+- Sriharsha -+- vsriharsha@rediffmail.com -+- A remarkably well-written article. Equips you with all that is needed to understand and develop scripts. Maybe ppl are looking for GUI based stuff, but CommandLineInterface is not doomed yet.

<PAT><PAT>

Keep going....
Harsha -+- 203.196.161.92 = Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020830 #2004-08-06 -+- k g upadhyay -+- pranav4@sancharnet.in -+- suggest some standard references for shell programming in unix -+- 61.0.51.29 = Mozilla/4.0 (compatible; MSIE 5.01; Windows 98; FunWebProducts; FunWebProducts-MyWay) #2004-08-16 -+- keyur m aytoda -+- www.priaml_prink@yahoo.com -+- script and menuscript example.
-+- 203.77.199.154 = Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) 2004-08-16 -+- pratap -+- pratapb@aztec.soft.net -+- It's a very nice article for UNIX bignners ,very thank full to the creater
of this article. -+- 203.124.222.15 = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FunWebProducts) 2004-08-22 -+- great article! -+- -+- Thank you for refreshing tutorial on BASH.

It complements my study with Quigley's Linux Shells by Example and Forta's Regular Expressions.

-+- 24.86.33.1 = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) 2004-09-03 -+- Murho -+- -+- Das ist ein schönes Website ... es gefällt mir sehr !
Mit viele Grüsse,
murho -> linux newbie.
-+- 217.7.122.74 = Mozilla/5.0 (compatible; Konqueror/3.2; Linux) (KHTML, like Gecko) 2004-09-13 -+- chandra reddy -+- creddy_m@yahoo.co.in -+- It is very useful to biginers.
Thank you -+- 203.200.36.253 = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) 2004-09-21 -+- Manoj Kumar Mishra -+- Manoj@bplitl.com -+- I encountered a problem when i am writting a shell script to add two digit number and a 10 digit number. it is working perfectly with a 9 digit number. so i want to know that is there any data type is there in shell programming or not and if it is there what is the limit for that. I think it should be atleast 32 bit long. so max value can be 4294967295 which is 10 digit number (unsigned). if it is signeed then max value is 2147483647.
i want to know whether there is aomething signed or unsigned concept is there in shell programming or not.


please help me out if anyone know something about that.

thanks in advance. -+- 203.124.210.98 = Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt) 2004-09-24 -+- RajilaTR -+- rajilatram@yahoo.co.in -+- Very useful for beginers............... -+- 210.212.228.7 = Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) 2004-10-05 -+- prasad -+- -+- This is very good article for unix shell scriping
many thanks for u r great help
-+- 203.124.158.2 = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) 2004-10-20 -+- JP -+- jpvarg@hotmail.com -+- I like the examples in this great article!

Thanks!
-+- 164.77.246.84 = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) 2004-10-25 -+- anthony -+- unsafespy2@yahoo.com -+- I am a beginner and I just wrote a basic script to remind me to pay my bills for the week...now how do i write the same script using the if/elif/else.. -+- 68.163.154.103 = Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; yie6) 2004-11-04 -+- John Thompson Jr. -+- ktone_1@yahoo.com;jthomps@neca.org -+- Hello I need help.

I'm trying to pass information from one file to a variable within an ifthen statement. ex: if ["$a" = "$1"];then ....

$1 is defined on the command line. $a is getting informataion from ps-aef. Any suggestions?? -+- 204.76.13.227 = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705) 2004-12-09 -+- arwoy digna -+- arwoy_digna@yahoo.com -+- i have a question ?how to write a shell prompt in pico,that is:
Write a program that asks the user to enter a base value followed by a decimal integer value. It then prints out the converted value to the specified base. You may print out the new digits in list form (comma separated). The program should repeat this process of asking for two numbers and printing the answer until the user enters zero for the base.
Enter a base number (or zero to quit): 8
Enter a decimal value to be converted: 255
The decimal value 255 in base 8 is [3, 7, 7]

Enter a base number (or zero to quit): 2
Enter a decimal value to be converted: 19
The decimal value 19 in base 2 is [1, 0, 0, 1, 1]

Enter a base number (or zero to quit): 0

-+- 198.101.34.50 = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322) 2004-12-10 -+- Suddha Satta Ray -+- ssray23@netscape.net -+- Wonderful article on Shell. I learnt a lot here.
Infact, this site has become like a mini-reference for me!!!
The examples are well chosen.
-+- 198.22.123.10 = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322) 2005-02-03 -+- Charlie Macchia -+- cmacchia@SpamMeNot.uhnres.utoronto.ca -+- Quickie - in the bash shell on OSX (FWIW), the conditional command -f does not appear to work if the path to the file, is included with the file name, thus:

if [ -f "/Users/Chaz/afile.txt" ] will fail no matter what, but

if [ -f /Users/Chaz/"afile.txt" ] works fine.

I've noticed on your site this example

Shortcut operators
People familiar with C will welcome the following expression:

[ -f "/etc/shadow" ] && echo "This computer uses shadow passwors"

if the issue above is generalized to Linux bash, then the [ -f "/etc/shadow" ] will also fail no matter what.

thought it was worth mentioning

Great site BTW
Charlie
-+- 70.49.103.250 = Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.5.6 (KHTML, like Gecko) Safari/125.12 #2005-02-13 -+- Manoj -+- kansaramanoj@yahoo.co.in -+- Dear frnd

if you are related to kansara pls contact me i wm very interested to contact Kansaras

with best regards
manoj kansara
-+- 213.42.2.10 = Mozilla/4.0 (compatible; MSIE 5.01; Windows 98) 2005-04-05 -+- shanmugam.s -+- kingshanmugam@yahoocom -+- thanks for all helps



good day -+- 202.141.29.35 = Mozilla/4.7 [en] (X11; I; SunOS 5.8 sun4u) 2005-10-27 -+- John Vogel -+- john55gc@yahoo.com -+- I would like to know how to run a 'C' function from a Unix script? -+- 216.222.127.29 = Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.0.1) Gecko/20020920 Netscape/7.0 2006-07-04 -+- Kris W -+- -+- As someone new to shell scripting, and someone who hates any tutorial that starts with the "hello" script.
This has been a rgeat deal more informative than any of the other regurgitations available on the net

Thanks -+- 207.216.0.106 = Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.4) Gecko/20060608 Ubuntu/dapper-security Firefox/1.5.0.4 2006-07-20 -+- Stu Gillis -+- sfgillis@gmail.com -+- I would like to point out a small error in your Backtick explanation.

You give the command to archive files as
tar xvf file.tar infile1 infile2 ...
instead of
tar cvf file.tar infile1 infile2 ...

A minor thing to be sure, but it could be confusing to a someone new.

Overall an exceellant resource that I will pass on to our LUG as a link.
-+- 65.199.107.131 = Mozilla/5.0 (compatible; Konqueror/3.4; Linux) KHTML/3.4.2 (like Gecko) 2006-08-24 -+- Ranga -+- -+- I am new to Shell Scripting in Linux. This article is very helpful to me in understanding the various basic concepts. Thanks a lot to the Authors. can you add some more easy examples towards the end, if possible? -+- 69.180.132.245 = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) 2006-10-05 -+- samer asbah -+- abutoto1983@gmail.com -+- i tried to learn shell script before , it was a little bit difficult to understand the basics before , but i think that this page was so helpfull.

Thanks a lot to who write it and to who support him -+- 217.66.226.52 = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7 #2006-10-26 -+- Gibin George -+- gibingeorge@nestcorp.net -+- HI DEAR FRIENDS,

I WANT TO STUDY SHELL SCRIPTING AS I FOUND IT IS INTERESTING.SO PLEASE TELL ME A BOOK FOR REFERENCE.I AM GRATEFUL IF YOU SEND ME THE NAME OF A GOOD BOOK TO BUY ,EASY TO UNDERSTSND. -+- 203.200.157.66 = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)