Required UNIX shell scripting material


 
Thread Tools Search this Thread
Operating Systems Solaris Required UNIX shell scripting material
# 1  
Old 12-28-2009
Required UNIX shell scripting material

As I am new in UNIX , and I want to learn UNIX shell scripting.

where shall I get material for Scripting ( For basics fundamentals and production environmental scripts)

Kindly provide me ......................
# 2  
Old 12-28-2009
2 good starting points are the Bash Guide for Beginners and the Advanced Bash-Scripting Guide. Mind tho, while the bash is POSIX compatible, it has quite some extensions that are not.
# 3  
Old 12-28-2009
Bash is not good shell because does not support POSIX instead leran Korn shell
# 4  
Old 12-28-2009
Wrong. The bash is as much POSIX compatible as the Korn Shell (ksh), as both are a super-set of the POSIX standard. True, the POSIX standard was derived from the Korn shell, but still both support it completely, only the extensions to it differ (and no very much at that). If you want something that has absolutely nothing to do with POSIX try the C Shell.

As a simple test: take any script that's fully POSIX compatible (without any ksh extensions) and run it with bash instead of the Korn Shell. I've yet to experience any differences.
# 5  
Old 12-28-2009
# 6  
Old 12-29-2009
yep totally compatible

Code:
http://www.gnu.org/software/bash/manual/html_node/Bash-POSIX-Mode.html

Smilie
# 7  
Old 12-29-2009
Did you read it completely? (emphasis added)
Quote:
[...]will cause Bash to conform more closely to the POSIX standard[...]
"more closely" for me means it's already compatible, just not as strict.

As for the list of things that change, these are relevant for non-interactive use (aka "scripting"):
Quote:
12. Non-interactive shells exit if filename in . filename is not found.
13. Non-interactive shells exit if a syntax error in an arithmetic expansion results in an invalid expression.
16. Function names must be valid shell names. That is, they may not contain characters other than letters, digits, and underscores, and may not start with a digit. Declaring a function with an invalid name causes a fatal syntax error in non-interactive shells.
20. A non-interactive shell exits with an error status if a variable assignment error occurs when no command name follows the assignment statements. A variable assignment error occurs, for example, when trying to assign a value to a readonly variable.
21. A non-interactive shell exits with an error status if the iteration variable in a for statement or the selection variable in a select statement is a readonly variable.
28. The . and source builtins do not search the current directory for the filename argument if it is not found by searching PATH.
Ad 12: that shouldn't be a problem, as I think it's pretty common to check if something is there before trying to access it
Ad 13: pretty much the same. It's like checking the value of the divisor before trying to divide by zero.
Ad 16: I can't image a situation where I'd need a function that has a '%' or '/' in it...
Ad 20: If you can't keep track of which variables are read-only and which aren't...
Ad 21: see above.
Ad 28: So it works the same as command lookup, which requires you to use the (IMO) more readable ". ./filename" instead of ". filename"

And while I myself prefer the Korn shell to bash, it isn't without incompatibilities itself, as the POSIX standard shell was based on ksh88, while the current, ksh93, features quite some changes.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell scripting help required

I have a shell script which calls a sql script. But in the output file I'm getting an additional '^L' character. Please advise how this is to be handled. spool /opt/oracle/DART/out/Indx_rebuild.out SET SERVEROUTPUT ON SET VERIFY OFF SET HEADING OFF SET NEWPAGE NONE SELECT 'ALTER INDEX '||... (2 Replies)
Discussion started by: narayanv
2 Replies

2. Shell Programming and Scripting

Required help in shell scripting

Iam new to shell scripting,i have a text file in my $home directory mentioned below. 201249_BAN_EXCL.TXT I need to refer the above file in my automated script but the number 201249 used to change every week.How can i refer to this file everyt time without renaming it manually? Thanks in... (7 Replies)
Discussion started by: Jroyal
7 Replies

3. Shell Programming and Scripting

guidance required: feed load search & display in shell scripting

Hi All, I am fairly new to Shell Scripting, however learning fast ;-) I have been asked to do the below basic shell script :confused: There are few feed files we are recieving in the server from multiple locations spread out during the day, rite now we are checking manually each file... (2 Replies)
Discussion started by: sachaan
2 Replies

4. UNIX for Dummies Questions & Answers

UNIX Study Material

Hi , Can anyone suggest me any UNIX Study material and UNIX Certification specific for TELECOM-DOMAIN. Best Regards, Om Prakash. (14 Replies)
Discussion started by: omprakash1986
14 Replies

5. Shell Programming and Scripting

Help Required in shell scripting

Hi, I am new to Unix shell scripting.I have a requirement where I have to search for a particular file in a Unix directory based on some criterian of the content of the file.Actually there would be two files with same name and then I have zip them together and stoe in the same directory. As... (1 Reply)
Discussion started by: Kunal Banerjee
1 Replies

6. Shell Programming and Scripting

PDF material required

Does anyone here have the AU23 Course material........ Edit: Please do not post your e-mail address while asking for help. (0 Replies)
Discussion started by: gurpreets
0 Replies

7. Windows & DOS: Issues & Discussions

Unix Material

Hi, Can anyone provide the UNIX material. Thanks. (1 Reply)
Discussion started by: biyyanimv
1 Replies

8. Shell Programming and Scripting

difference between AIX shell scripting and Unix shell scripting.

please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies

9. UNIX for Dummies Questions & Answers

question on UNIX material

I am currently a student at Bergen Community College. My major is Networking Administration. I am having a tough time with INF-254 (UNIX). I need some help! What is "README bit" I am having trouble understanding certain concepts: For Example, what does it mean to set SUID, or SGID? ... (1 Reply)
Discussion started by: nelson ele
1 Replies

10. New to Unix. Which books should I read?

UniX internals Material

Hi! I have 1.5 years experience in unix environment and shell scripting. Now, I started learning UNIX internals and network programming. Can you please help in finding the same material on the net Thanks Srinivas. (7 Replies)
Discussion started by: srinivaskathika
7 Replies
Login or Register to Ask a Question