Hello again dear Daniwebians,

I am asking for some ehlp again. I wrote a littel cript as part of my assigment. My script does what it is suppose to do, but when I run it, it does not end on its own, I have to stop it by "killing" the process by striking the ctrl-d set of keys. I check for my output and it is all there. Can some one tell me why it is doing (optional) and how do I stop it from hanging?

here the script:

#!/vin/csh 

#1.a
echo 'Exercise 1.a' >> assn3a.output
whoami >> assn3a.output
echo $'\n' >> assn3a.output

#1.b
echo 'Exercise 1.b' >> assn3a.output
date >> assn3a.output
echo $'\n' >> assn3a.output


#1.c
echo 'Exercise 1.c' >> assn3a.output
who >> assn3a.output
echo $'\n' >> assn3a.output


#1.d
echo 'Exercise 1.d' >> assn3a.output
pwd >> assn3a.output
echo $'\n' >> assn3a.output


#1.e
echo 'Exercise 1.e' >> assn3a.output
mount >> temp1
cat temp1 >> assn3a.output 
echo $'\n' >> assn3a.output


#1.f
echo 'Exercise 1.f' >> assn3a.output
ps >> temp2
grep 'd$' temp2 >> assn3a.output
echo $'\n' >> assn3a.output

#1.g
echo 'Exercise 1.g' >> assn3a.output
grep /etc/host >> assn3a.output
echo $'\n' >> assn3a.output


#1.h
echo 'Exercise 1.h' >>assn3a.output
grep 'marvin' /etc/passwd >> assn3a.output
echo $'\n' >> assn3a.output

A three things. First your first line (the she-bang) is incorrect. You should fix it.
Second, the section headers should be commented out.
Third, and most importantly, there is an error in exercise 1g.

(as this is a school exercise, I will let you find out how to fix these).

Although after 2 months, you should have completed this already

Which command can take input from stdin?
Under what circumstances?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.