creating shell loop homework help


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers creating shell loop homework help
# 1  
Old 05-19-2011
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 replace with other words like "Yes Sir%". So instead of "mycomputer%" it will end up like this "Yes Sir %". The requirements cannot be done in string but in arg and fork. It must loop back to saying Yes Sir% after i tell it to do something. I am stuck and been doing this Smilie for a while now so i need help.
# 2  
Old 05-19-2011
Hello.

Please do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Creating for loop for tar -tvf doesnt work

hi all, i have created a for loop, it looks like this - #!/bin/bash cd /mnt/local/data/tars for tar in * do base=$(basename "$tar") "$base" -tvf >> /mnt/local/data/logs/"$base".csv done but i get this error - ./tar_loop.sh: line 8:... (2 Replies)
Discussion started by: robertkwild
2 Replies

2. Shell Programming and Scripting

Creating new file inside a for loop

Hi, I have list of files present in a folder. I want to search for a particular keyword sequentially and create a file which will be later used by some other program. Input files: $ ls a.dsx b.dsx c.dsx Dataline_.txt Dataline.txt loop.sh $ cat *.dsx help tyiis global for i in... (4 Replies)
Discussion started by: mac4rfree
4 Replies

3. Shell Programming and Scripting

Creating a loop for multiplying columns

I have 2 files, that look like this: ID SNP1 SNP2 SNP3 SNP4 A1 1 2 0 2 A2 2 0 1 1 A3 0 2 NA 1 A4 1 1 0 2 and this: SNP score SNP1 0.5 SNP2 0.7 SNP3 0.8 SNP4 0.2 Basically, all of the SNP-values are 0,1, 2 or NA, and they each have a score, listed in the second file. The total... (5 Replies)
Discussion started by: kayakj
5 Replies

4. UNIX for Dummies Questions & Answers

Creating a loop to go through grep output

I'm doing this script in my Unix class and I've come to a roadblock. The purpose of this script is to search users directories for files that contain bad words i.e kill murder bomb etc., and then be able to ignore legitimate files with each use. I got the searching and ignoring part down but now... (1 Reply)
Discussion started by: jrod44
1 Replies

5. Shell Programming and Scripting

Creating variable by for loop

i have a file 'detail' which contains cat detail 111111 222222 333333 444444 but detail may be 4 line file.6 line file or 8 line file like cat detail 111111 222222 333333 444444 555555 666666 777777 888888 so i want a declare a loop which assign the value of first line in one... (11 Replies)
Discussion started by: rakeshtomar82
11 Replies

6. Shell Programming and Scripting

Creating a loop in csh

I have the following code and want to use a loop to output the results to the fparams file. if ($optparams == 1) then # Set the tdarwin parameters set txt01 = "Call to raytrac.csh" set txt02 = "" set txt03 = "./Scripts/raytrac.csh $*" set txt04 = "" set txt05 =... (0 Replies)
Discussion started by: kristinu
0 Replies

7. Shell Programming and Scripting

redirecting output and creating condition for while loop.

I have 2 questions. 1) Is there a means of directing output to a file (">") while making it still output to the console? I have a script that calls another lengthy script. 2) I can direct the output of the lengthy script and grep it for the words "good" or "bad" to know if I need the run... (2 Replies)
Discussion started by: mrwatkin
2 Replies

8. Shell Programming and Scripting

need help creating a shell that generates another shell

hi all, i'm trying to create a shell script that browse files in a directory and generates another shell script based on these files. for ex: /tmp/files/ is the directory i want to browse and it has 2 files file1.sh and file2.sh. now my shell script should browse /tmp/files/ and... (6 Replies)
Discussion started by: adshocker
6 Replies

9. Shell Programming and Scripting

Creating loop for a script -Perl

Hi Guyz I designed a script that can compare 2 columns(values) of single file and gives the closest numbers to the first column by comparing the numbers in first column with second and it works in a single file. Now I'm trying to design a new script with 2 objectives for 2 files (not a single... (4 Replies)
Discussion started by: repinementer
4 Replies

10. Shell Programming and Scripting

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... (2 Replies)
Discussion started by: tintin
2 Replies
Login or Register to Ask a Question