Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 15 Dec 2018, 05:33
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Bash If...then syntax driving me nuts!
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 2 [19 Posts]   Goto page: Previous 1, 2
Author Message
jafadmin

Joined: 19 Mar 2009
Posts: 859

PostPosted: Wed 30 May 2018, 19:52    Post subject:  

WIckedWitch wrote:
Potentially controversial suggestion: Use Tcl instead of bash.

No. Linux ships with bash. It's ubiquitous. Why write scripts in a language that doesn't ship with the OS? That is the true definition of insanity.
It's like saying you invented a really superior PC that works great with 71HZ AC ..
Back to top
View user's profile Send private message 
WIckedWitch

Joined: 29 Mar 2018
Posts: 262
Location: West Wales bandit country

PostPosted: Thu 31 May 2018, 13:05    Post subject:  

jafadmin wrote:
WIckedWitch wrote:
Potentially controversial suggestion: Use Tcl instead of bash.

No. Linux ships with bash. It's ubiquitous. Why write scripts in a language that doesn't ship with the OS? That is the true definition of insanity.
It's like saying you invented a really superior PC that works great with 71HZ AC ..


My reason for not using something that ships with the OS is that scripts written in an OS-specific language are not portable across platforms. By using Tcl, I have to be familiar with just one scripting shell across all platforms that I use: Windows, MacOS, Linux and various *NiXes.

And by using Tk and other Tcl extensions such as SQlite and Expect, I can do more in Tcl more easily than I could using OS-specific shell scripts. Indeed I routinely prototype applications in Tcl, then, if they need to be in a native-compiled language, simply re-implement in C using the Tcl C API.

It's not without reason that Tcl is sometimes called the "Swiss Army knife of programming languages", or sometimes "the best kept secret in software engineering"..

I'll admit, however, that my inclination to write things portably has in the past been regarded by some colleagues as "anally obsessive". That's almost right because I'm actually autistically obsessive.

_________________
Sometimes I post mindfully, sometimes not mindfully, and sometimes both mindfully and not mindfully. It all depends on whether and when my mind goes walkies while I'm posting Confused
Back to top
View user's profile Send private message 
jafadmin

Joined: 19 Mar 2009
Posts: 859

PostPosted: Thu 31 May 2018, 16:22    Post subject:  

WIckedWitch wrote:
My reason for not using something that ships with the OS is that scripts written in an OS-specific language are not portable across platforms. By using Tcl, I have to be familiar with just one scripting shell across all platforms that I use: Windows, MacOS, Linux and various *NiXes.


That's great when you are only concerned about your own needs. It does absolutely nothing for others though.

If you peruse this forum you will find hundreds of examples of Linux users helping others with scripts. That is only possible because all have a common shell.

Don't hold your breath waiting for everyone to install tcl just so they can run your scripts.

The cool thing about Computer Science is you learn to program in all languages.
Back to top
View user's profile Send private message 
WIckedWitch

Joined: 29 Mar 2018
Posts: 262
Location: West Wales bandit country

PostPosted: Thu 31 May 2018, 17:24    Post subject:  

jafadmin wrote:
WIckedWitch wrote:
My reason for not using something that ships with the OS is that scripts written in an OS-specific language are not portable across platforms. By using Tcl, I have to be familiar with just one scripting shell across all platforms that I use: Windows, MacOS, Linux and various *NiXes.


That's great when you are only concerned about your own needs. It does absolutely nothing for others though.

If you peruse this forum you will find hundreds of examples of Linux users helping others with scripts. That is only possible because all have a common shell.

Don't hold your breath waiting for everyone to install tcl just so they can run your scripts.

The cool thing about Computer Science is you learn to program in all languages.


That's fine. I did say earlier on that recommending Tcl was a little provocative. Basically It's down to my own dilapidations. I've always found sh and bash scripts impossible to read, so I never use them except in tiny trivial cases.

Whenever I set up a new OS on a machine, the first three things I install are gcc, Tcl/Tk and Python. Thereafter, I never go near sh and bash unless I need to execute the very occasional sh or bash command from within a Tcl script.

I agree with you about using lots of programming languages but there are just some that I avoid like the plague because I find them disagreeable to use. Over the years I have used: Algol60, Algol68, Ada, BASIC, BCPL, C, C++, CCS, COBOL, CPN, CSP, Eiffel, Erlang, Estelle, FORTH, FORTRAN, Java, Javascript, LISP, LOTOS, Lua, Matlab, ML, OCAML, Octave, Pascal, Perl, Prolog, Python, R, Ruby, SCADE, Smalltalk, Tcl, Visual Basic, Z, various shell scripting languages, assembler, and maybe one or two others that escape me. (Not all of these are PLs - some are formal description languages.)

After all that lot, one develops favourites and things one won't touch with a barge pole. I viscerally loathe: C++, Estelle, Java, Javascript. LISP, Perl, Visual Basic and the sh and bash shell languages. Nowadays, at 65, I'm a lot slower at learning things, so I stick with the set of languages that I feel comfortable with - and generally, the more formally defined, the better.

My language prejudices are undoubtedly strongly coloured by having worked for 25 years in safety-, security- and mission-critical systems.

Sorry if I came on a bit strong as regards Tcl. I didn't mean to sound dismissive. It's just me becoming a grumpy old woman Smile

_________________
Sometimes I post mindfully, sometimes not mindfully, and sometimes both mindfully and not mindfully. It all depends on whether and when my mind goes walkies while I'm posting Confused
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 2 [19 Posts]   Goto page: Previous 1, 2
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0465s ][ Queries: 12 (0.0143s) ][ GZIP on ]