Help in UNIX

Status
Not open for further replies.

Biancaj28

Junior Member
Dec 7, 2011
1
0
0
Hello all,

I am in the intro class of unix and it is still kicking my butt. I am in dire need of explanation of how to do some things. If ANYONE can help I would be eternally grateful....
I have attempted the awk but am not sure if it is remotely correct or not.... see the answer I came up with below

Write a sed command in a new file to replace all : in the file FinalTest with “. Show the output and the command.


Write an if statement that will echo the number of command line arguments ($#) or else it will echo “there are too many” if there are more than four.



Write a script that will ask for your name. It will then echo your name and tell you what script you are running ($0).



Write a script that will ask the user for a file, create the file, and then delete that same file. Be careful when testing this script!


Write an awk script that will output just your username from /etc/passwd.
js@socrates:~$ ls -la | awk /etc/passwd:confused:
total 668
drwxr-xr-x 8 js cs146 4096 2011-12-07 10:20 .
drwxr-xr-x 370 root root 12288 2011-10-12 07:55 ..
-rw-r--r-- 1 js cs146 61440 2011-11-23 09:31 +1
-rw-r--r-- 1 js cs146 0 2011-10-12 08:25 ab
-rw-r--r-- 1 js cs146 0 2011-10-12 08:28 ab2

We're not big on people simply pasting their homework questions here and asking for answers. Feel free to post anything you have actually done some work on and still need help with.

Markbnj
Programming moderator
 
Last edited by a moderator:
Status
Not open for further replies.