LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-13-2013, 12:13 AM   #1
YesNew2linux
LQ Newbie
 
Registered: May 2013
Distribution: RHEL5, Centos
Posts: 3

Rep: Reputation: Disabled
Scripting advise


Hello everyone. I'm a little new to Linux but I have a basic programming background and would like to know which would be a preferred scripting language. Is python better or is bash scripting better?

Thanks
 
Old 05-13-2013, 12:27 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
bash is the (usual) cmd line shell language, so I'd start with that, to get familiar with Linux & scripting.
After that, there is range of languages you can look at.

Try these for Linux/bash
http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/
 
1 members found this post helpful.
Old 05-13-2013, 01:43 AM   #3
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,133

Rep: Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273
Quote:
Originally Posted by YesNew2linux View Post
Is python better or is bash scripting better?Thanks
Actually bash is a must, you will not be able to do anything without it. The next step can be any other language (like python)
 
1 members found this post helpful.
Old 05-13-2013, 06:18 AM   #5
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
Bash can do many system/world-level solutions and is easy when a quick solution is needed. Please check Ruby as well.
 
1 members found this post helpful.
Old 05-13-2013, 06:32 AM   #6
kooru
Senior Member
 
Registered: Sep 2012
Posts: 1,385

Rep: Reputation: 273Reputation: 273Reputation: 273
Hi and welcome to LQ!
Bash, of course.
 
Old 05-13-2013, 09:22 AM   #7
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,480

Rep: Reputation: 1020Reputation: 1020Reputation: 1020Reputation: 1020Reputation: 1020Reputation: 1020Reputation: 1020Reputation: 1020
The shell, be it BASH (Bourne Again Shell), ksh (KornShell), sh (the original shell program developed primarily by Stephen Bourne at Bell Labs for Unix), the C-Shell (developed at Berkeley) along with various flavors and variants are command and programming languages.

When you fire up a Linux system and log in, you're presented with a shell prompt (if the system starts at run level 3 (non-graphic); if it starts with GNOME, KDE, Xfce or some other window manager you need to open a terminal emulator to get a shell prompt.

From that prompt, you can execute programs and utilities piping the output of one program into the input of another program as necessary or you can write a shell program ("script" isn't really correct, what you're actually doing is writing a shell program that you can save as a file, make it executable and then type its name to execute it) to perform useful work (hopefully!). Shell programming has grammar and syntax rules just like any programming language (C, FORTRAN, whatever). You may be surprised how many shell programs there are on your system; e.g.,
Code:
cd /usr/bin
file * | grep POSIX
(that should be over 400). One example that is frequently used is whatis; it's a shell program (on most systems). Back in the day, when Unix was developed, folks worked on terminals; from Teletypes to video, keyboard and display integrated in one box, no graphics (other than curses), text all the way and did a great deal of useful work. Truth is, you still can -- if you know the grammar and syntax, that is.

It's really a good idea, if you're serious about getting the most out of your system, to take the time to learn shell programming. At some point, you're going to hit a problem you need to solve and you won't be able to do it with some pre-built application -- if you know how to write a shell program, you can, typically, solve a problem without resorting to a higher-level programming language (not always, certainly, but more frequently than you might think).

It's worth your time to learn.

Hope this helps some.
 
2 members found this post helpful.
Old 05-14-2013, 05:27 PM   #8
YesNew2linux
LQ Newbie
 
Registered: May 2013
Distribution: RHEL5, Centos
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks everyone. Having a feeling I am gonna enjoy being a member
 
Old 05-14-2013, 06:47 PM   #9
vickynash
LQ Newbie
 
Registered: May 2013
Posts: 15

Rep: Reputation: Disabled
thank you tronayne, those lines did help me, worth reading as same worth learning bash

Last edited by vickynash; 05-14-2013 at 06:48 PM.
 
  


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
Please advise Buddhika Linux - Newbie 7 07-15-2012 04:27 PM
LXer: Scripting the Linux desktop, Part 2: Scripting Nautilus LXer Syndicated Linux News 0 02-17-2011 05:02 AM
Scripting help/advise on hiding/masking username/password newbie01.linux Linux - General 2 03-15-2010 10:29 AM
Need advise gloveny Linux - Newbie 11 07-10-2006 12:51 PM
teaching shell scripting: cool scripting examples? fax8 Linux - General 1 04-20-2006 05:29 AM


All times are GMT -5. The time now is 06:35 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration