Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

New user needs help with bourne shell script

$
0
0
This is my question, below the question is the template

Write and execute a Bourne shell script called homework that will

From within the script, create three background processes:
a) (2 points) one that saves a long listing of your hidden files to a file named hiddenlist
b) (2 points) one that saves a full listing of the status of your current running processes to a file named pstat
c) (2 points) one that stores only the count of the number of words from the file homework2 into a file named wordcount
d) (1 point) issue a command to wait for ALL three background processes to complete.
e) (1 point) give the user a message stating that the process are completed



1.There are no variables.

2. Relevant commands, code, script, alogrithems.
The relevant command would be cat to create files the | to join commands
for a I would need ls -la
for b I would need ps
for c I would need wc
for d I would need wait
for e I would need echo

3. Here is one of the many attempts I have made to solve this problem, I have many more but don't want
to flood the forum with my failed attempts.




Code:

cat > hiddenlist | ls -la > hiddenlist
cat > pstat | ps > pstat
cat > wordcount | wc homework2 > wordcount
wait

echo “Background Processes complete”


4. California State University Fullerton, Fullerton California USA Floyd Holiday CPSC253U

Viewing all articles
Browse latest Browse all 16232

Trending Articles