shell homework


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting shell homework
# 1  
Old 05-01-2005
shell homework

How does the expenditure of the following commands see out (in a sh-compatible Shell as bash or ksh)?

a) A=2; echo $A; ( echo $A; A=5; echo $A ); echo $A
b) B=2; echo $B; sh -c 'echo $B; B=5; echo $B'; echo $B
c) C=2; export C; echo $C; sh -c 'echo $C; C=5; echo $C'; echo $C

Explain in each case, why the expenditures indicated by you come!

Hey,

this is the last task of my homework. I really do not know how to answer the question.
I would be very happy if you can help me.

thank you very very much.

ciao

tim
# 2  
Old 05-01-2005
Please follow the forum rules and do not post homework.

Quote:
(6) Do not post classroom or homework problems.
Homework is there to stretch you. There are many sources you can search and it really is the search that will make you remember. Good luck.

Keith
# 3  
Old 05-02-2005
sorry for adding a post to a closed thread, but I felt I had to post.

One of the reasons I beleive homework should be done by you is that it forces you to think or "stretch" your brain as above.

Ponder the problem and let it rattle around in your head. Plus with the web you can probably find similar examples you can discover and figure out.

Then come back here after you have considered the answer. Present an educated answer you came up with and ask for feedback regarding your answer, not the question. And you might get some good feedback.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Helping a Newbie with Shell Homework

Good Evening, i got a homework where i have to list all files in the directory with the name length >=3 and <= 6 and after trying it for 2 days my Prof gave me a bit of code: #!/bin/bash for file in $(ls) do done after that he told me "now you only have to use wc and you got it" but... (1 Reply)
Discussion started by: Mentoss
1 Replies

2. Homework & Coursework Questions

Homework Help

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: 2. Relevant commands, code, scripts, algorithms: Write a command to display lines ending with the... (1 Reply)
Discussion started by: elh009
1 Replies

3. Homework & Coursework Questions

Homework

plz i need code to search about numbers like this : 962785785698 962795565488 962785321565 962777321684 962795979515 i need code to detect just numbers start with "96278" i need it in awk !! thanks (1 Reply)
Discussion started by: eyad mohammad
1 Replies

4. Homework & Coursework Questions

Please help me with my homework!!!

A shell script is a script written for the shell, or command line interpreter, of an operating system. Typical operations performed by shell scripts include file manipulation, program execution, printing text etc. Shell : In computing, a shell is a piece of software that provides an interface for... (1 Reply)
Discussion started by: ubun
1 Replies

5. Shell Programming and Scripting

Homework

1. Write a shell script to print the file names of all files having .txt extension of a given directory after converting to uppercase letters. The input (directory name) should be given as command line argument. The script will also check whether sufficient arguments are passed or not and whether... (1 Reply)
Discussion started by: aninda1989
1 Replies

6. UNIX for Dummies Questions & Answers

creating shell loop homework help

Hello, i am new to unix and i had done very little assignment in unix. I need help on a homework assignment where i am require to create my own file call myshell. In the file it must have the commands that loop. Instead of displaying a regular command path like my computer name instead it is... (1 Reply)
Discussion started by: megaearth77
1 Replies

7. UNIX for Dummies Questions & Answers

Homework :(

1. You have a very large file, named 'ColMe', tab-delimited, you are asked to process. You are told that each line in 'ColMe' has 7 columns, and that the values in the 5th column are integers. Using shell functions (and standard LINUX/UNIX filters), indicate how you would verify that these... (1 Reply)
Discussion started by: mb774
1 Replies

8. Shell Programming and Scripting

korn shell homework

here are the questions for ya...im stumped 1)the command "dirname path" treats path as a pathnameand writes to the standard output the path prefix, that is everything up to but not including the last component. thus "dirname a/b/c/d" write a/b/c to standard output. If path is simple filename... (1 Reply)
Discussion started by: Loppdawg69
1 Replies
Login or Register to Ask a Question