Sponsored Content
Top Forums Shell Programming and Scripting Question about Shell Programming Post 18159 by AtleRamsli on Monday 25th of March 2002 08:54:48 AM
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!
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
ATF-SH(1)						    BSD General Commands Manual 						 ATF-SH(1)

NAME
atf-sh [-s shell] -- interpreter for shell-based test programs SYNOPSIS
atf-sh script DESCRIPTION
atf-sh is an interpreter that runs the test program given in script after loading the atf-sh(3) library. atf-sh is not a real interpreter though: it is just a wrapper around the system-wide shell defined by ATF_SHELL. atf-sh executes the inter- preter, loads the atf-sh(3) library and then runs the script. You must consider atf-sh to be a POSIX shell by default and thus should not use any non-standard extensions. The following options are available: -s shell Specifies the shell to use instead of the value provided by ATF_SHELL. ENVIRONMENT
ATF_LIBEXECDIR Overrides the builtin directory where atf-sh is located. Should not be overridden other than for testing purposes. ATF_PKGDATADIR Overrides the builtin directory where libatf-sh.subr is located. Should not be overridden other than for testing purposes. ATF_SHELL Path to the system shell to be used in the generated scripts. Scripts must not rely on this variable being set to select a specific interpreter. EXAMPLES
Scripts using atf-sh(3) should start with: #! /usr/bin/env atf-sh Alternatively, if you want to explicitly choose a shell interpreter, you cannot rely on env(1) to find atf-sh. Instead, you have to hardcode the path to atf-sh in the script and then use the -s option afterwards as a single parameter: #! /path/to/bin/atf-sh -s/bin/bash ENVIRONMENT
ATF_SHELL Path to the system shell to be used in the generated scripts. SEE ALSO
atf-sh(3) BSD
September 27, 2014 BSD
All times are GMT -4. The time now is 04:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy