Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
1) There are many online discussions -- the most common Csh Programming Considered Harmful. Which is a decent discussion on why using csh for programming is generally a bad idea. Note, I prefer tcsh as my main method of interaction but rarely use it for scripts unless the script is very basic and not going to leave my control.
2) /etc/passwd determines the default shell.
3) I have no idea what you're asking.
4) echo $SHELL; should tell you the current shell... this is not true in reality often enough to make me uncomfortable even suggesting it. Often changing shells does not change this.
5) It should not matter... your regular shell will not play a role as long as the first line points to a valid shell. Note, some systems do not correctly support this and will always use /bin/sh -- no modern system I know of has that limitation. It is also important to note that /bin/bash is not standard and will not work on most *nix operating systems outside linux. /bin/sh will always work but will not always point to bash.
Although it is fine to use bash if you want for your own stuff... it does effect portability and you should consider using plain bourne shell without bash syntax if possible. Just a word of advice from someone who spent a few years passing scripts from *BSD to Linux to Solaris.
You know, I just do very little actual Bash-shell scripting. I normally use Python. I know of others who swear by (or swear at)Perl. Still others use PHP for web-sites and also use it for other scripting tasks as well.
You can build entire applications, cross-platform ones at that, with Python tools like "Boa Constructor," which is extremely nice.
It is very nice to be able to "script things," although I find it very painstaking to do it in Bash-scripting. Given the plethora of other, better choices out there, I simply use one of those.
Note: The so-called "shebang" #! that you'll find at the start of any shell-script specifies the command-processor to be used. So you can write a command, and execute it, in any of these languages with no difference in how you invoke them.
Those langauges sound great and I will learn them. I am getting into Linux for one reason, to use a specific weather analysis program called GEMPAK. GEMPAK requires that a set-up file called Gemenviron be run and I was given both a bash and csh version of this file.
I wrote scripts which make use of wget to retrieve the weather data for GEMPAK. They all work but I started running into problems putting them into crontab.
You sound alot like I was ceaseless. I needed to automate several of the things that I'm working on and with much help from this forum (Thank you all) I've learned quite a bit on scripting with bash. I am currently learning perl and because I have a good understanding of how bash is structured I'm having a much easier time learning it and it's making sense to me. I agree with posts above about learning one well and then trying another.
You've picked the right place for help... There are some amazingly sharp people here.
# Gemenviron file for GEMPAK 5.8
# Sets environment variables used in running GEMPAK
# UNIDATA Program Center 6/1/92 (PB)
# Revised 8/31/94 for GEMPAK 5.2
# Modified 12/95 for Gempak5.2.1/Nawips (Chiz)
# Modified 8/96 for Gempak5.4/NAWIPS (Chiz)
# Modified 10/00 for Gempak5.6/NAWIPS (Chiz)
# Modified 3/04 for Gempak5.7/NAWIPS (Chiz)
# The command
# source Gemenviron
# or the individual lines below, must be included in your .login or
# .cshrc file!