Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
c shell script help PLEASE
Name: Sharan Date: December 12, 2002 at 11:12:21 Pacific OS: sun 5.8 CPU/Ram: sun 5.8
Comment:
Please help me on two shell scripts:
1. the script simulates the ls -l command but prints only three columns of our choice.
2. the script makes a file out of the information in the etc/passwd. file using the following format: User Name User ID Group ID Home Directory
Name: struzzo Date: December 12, 2002 at 23:10:27 Pacific
Reply:
Hi,
i think this is your homework! I don't tell you the full solution. But have a look into the awk manpages!!!
Have a nice day
greets struzzo
0
Response Number 2
Name: Sharan Date: December 13, 2002 at 20:07:06 Pacific
Reply:
You are right. That's my homework. I've been staring at them for three weeks. I believed that if my book knows how to complain, I am in the jail right now (because I abused it badly). The book doesn't really help a beginner beginner like me. Anyway, that's for your help!
Sharan
0
Response Number 3
Name: David Perry Date: December 27, 2002 at 12:43:14 Pacific
Reply:
awk deals with input generally separated by spaces but can be forced to use other field separators.
ls -l | awk '{ print $1 " " $4 }'
will print the first column, a space and the fouth column
cut can deal with any single character as a field delimitor, but in this case it would be easier to name the field separator in awk
Summary: Hi, I am very new to Unix (taken one week of class so far) and have been given an assignment that I find impossible to accomplish. It seems like a very advanced assignment. The assignment is as fo...
Summary: I need help on writing 2 shell scripts: 1) Write a shell script, to be called `keep', that will take any number of file names as arguments. It should remove all files from the current directory...
Summary: I am learning c shell and i am trying to do this problem. This is the question 1) check that an argument was entered on the command line and that it is the name of a directory file 2) if no argument w...