Question about Shell Programming


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Question about Shell Programming
# 1  
Old 03-22-2002
Question about Shell Programming

First, I'd like to know if being a shell programmer considered a "real" programmer. is it??


also, I do create a lot of shell programs which includes full scripts to create users and maintaining records. ie phone records.

now, I hear the programmer has to do some cleaning up after the program he/she created finish running. I dont understand this part. what does that mean??? are there any relevant cleaning up I need to know about???

Please, any share any information you might have about this topic.

thanks
# 2  
Old 03-22-2002
It has been my experience, that true "shell programming"
is in fact "programming". I have seen, used and even written
some very complex and highly functional shell programs.

There are some however that do feel this is NOT "real"
programming. I would venture to say that these folks
either have never written anything in a "shell language"
or have simply just "dabled" in small scripts from time to time.

So I guess it's all a matter of opinion and degree Smilie

As far as cleanup goes, most often this refers to the use
of temporary files and such when writing shell programs.
In which case, you should "clean up" after using them meaning,
remove them. In the case of other programming languages it
may also apply to closing network and/or DB connections and
such.
# 3  
Old 03-25-2002
The question of what is 'programming' or not is actually quite interesting.
The autors of Beta (www.mjolner.com - look for Beta, Solaris or Linux version) say that everything relating to system development is programming, including drawing up UML diagrams, doing object analysis, even requirements alalysis.
This is why their Mjølner system can be programmed using UML diagrams (the object analysis part,anyway). If shell programming is not programming, then what is?
The only difference between a shell script and a binary is in the way it is being executed - completely transparent to both programmer and user.
If interpreted programs were not 'real' programs, then what to say about Java? Java programs are interpreted /and/ compiled!
In fact, there is nothing that stops you from writing a compiler for you shell script and running it as a binary ... or running a C-program in an interpreter.
I know what this is about: What is the most macho programming one can do?
Answer: cat > prg.
Then enter the ASCII codes that correspond to the CPU instructions you want executed, if one of them is 0x4 then you can not continue, MOV store to accumulator on a 16-bit ISA PC system, fx. is in binary 1010000wLLLLHHHH, you fill in the operands, look up the corresponding ASCII characters, and write them into the file after the ELF header and stuff. That way, you can run 'arbitrary code' on a Linux system with only cat and write permissions as your tools. You don't get more macho than that, but is it 'programming'?
Sure!
Is it 'serious programming' - no way!
# 4  
Old 03-26-2002
Cleaning up, in many cases that I've seen in shell scripting, means removing any temp files, unsetting any variables that may make it into a shell session (doesn't happen all that often - most scripts are run as a child process, as opposed to "sourced", or run as a string of commands in the current process), and handling signals properly (if the job runs as a daemon, does it ignore the SIGHUP signal correctly? What does the script do when it hits an error, or something it doesn't know how to deal with?).
Any other things to watch out for, anyone?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

Plz Help Me in This question in Shell Programming

2- Write a bash shell script filestatic. The script should examine the number files in directories given as arguments (parameters) to this script. a. if one argument is given, the script should count and report the number of files in this directory. Only regular files should be counted, not... (1 Reply)
Discussion started by: tahseen_22334
1 Replies

2. Shell Programming and Scripting

Plz Help Me in This question in Shell Programming

2- Write a bash shell script filestatic. The script should examine the number files in directories given as arguments (parameters) to this script. a. if one argument is given, the script should count and report the number of files in this directory. Only regular files should be counted, not... (1 Reply)
Discussion started by: tahseen_22334
1 Replies

3. Shell Programming and Scripting

Beginner Shell Programming Question

Hello all, I am currently try to learn the linux operating system as well as some bash programming. I have come across some online course work which has been very helpful, I have been working through some assignments and since I have no teacher to ask I have come to you experts. So the... (6 Replies)
Discussion started by: g2axiom
6 Replies

4. Shell Programming and Scripting

question about testing in shell programming

In folder A i have a file "a' and text file named infile00.I would like to do redirection :a<infile01. There is a code to do this #get a file "a" in /home/A for file in `ls /home/A` do if then #printing out if file is an execute file echo $file "is an execute... (6 Replies)
Discussion started by: thungmail
6 Replies

5. Shell Programming and Scripting

question about testing in shell programming(modifications were made)

In folder A i have a file "a' and text file named infile00.I would like to do redirection :a<infile01. There is a code to do this #get a file "a" in /home/A for file in /home/A/* do if $file ] then #printing out if file is an execute file echo $file "is an... (2 Replies)
Discussion started by: thungmail
2 Replies

6. Shell Programming and Scripting

question about testing in shell programming

I have 2 different directories. The first has 2 sub-folders A and B. The second as 2 sub-folders C and D and script named "script".There is a code of "script" to list 2 sub-folders C and D #!/bin/sh for file in * do && echo $file done I would like to ask how can I make a change if I... (2 Replies)
Discussion started by: thungmail
2 Replies

7. Shell Programming and Scripting

question about testing in shell programming

Hi i would like to write a "script" which takes a directory as an argument and the script will output the content of a file in this directory.Here is my code #!/bin/sh #set an argument to be a specified path $1=/home/tuan/Desktop/Shell_programming/directory #check if an argument is a... (3 Replies)
Discussion started by: thungmail
3 Replies

8. Shell Programming and Scripting

question about testing in shell programming

I created a file named q2.c in /home/tuan/Desktop/Shell_programming. I coded a script named "test" to check whether the file existed or not. My code : #!/bin/sh submitDir=/home/tuan/Desktop/Shell_programming/submit if then echo "There is no q2.c" else echo "There is q2.c" fi After... (3 Replies)
Discussion started by: thungmail
3 Replies

9. Shell Programming and Scripting

question about about Shell programming

1.if 2.then 3. # save the number of args and first argument in variables. 4. num_args=$# 5. id="$1" 6. echo "$id" 7. #echo "$1" > crapfile.txt 8. echo `sed 's/\*/'\*'/g' < crapfile.txt` Above is a partial code.I would like to ask: at line 1:... (1 Reply)
Discussion started by: thungmail
1 Replies

10. Shell Programming and Scripting

Post Shell programming: Question about source a file and read data from the file

This is shell programming assignment. It needs to create a file called .std_dbrc contains STD_DBROOT=${HOME}/class/2031/Assgn3/STD_DB (which includes all my simple database files) and I am gonna use this .std_dbrc in my script file (read the data from the database files) like this: .... (3 Replies)
Discussion started by: ccwq
3 Replies
Login or Register to Ask a Question