|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi
I'm a newbie here so sorry if I sound like an idiot. I'm studying Unix at the moment and am in the midst of my mid term assignment, but am having problems with some questions and was hoping you guys could 'please' help me. 1 - List files in you home directory and output ONLY the file count (number of files) to the command line - using the list command and piping. 2 - Remove all files ending in a numer OR capital letter - using the ls command. 3 - Manipulate the date command so that it outputs the date only like so: Mar 21 2005. Using a pipe to sed, insert a comma after the day so that the output becomes Mar 21, 2005. Also Im having some problems with some sed and grep things (just can't get the grip of it). What will be matched by the following regular expressions - i- ^Hello$ ii- [0-9]\{1,3},[0-9]\{3\} iii- ^\.. and finally Change multiple blank lines in the file to single blank lines (we are using a standard vi txt file). If anyone can please help with either one or all of these I would be eternally grateful. Thanks so much Ensign47 |
|
#2
|
||||||
|
||||||
|
although it IS a homework and anyone here would expect SOME kind of input from the poster in terms of the solution.....
here's something to go on.... Quote:
ls -l | sed -n '/^-/p' | .... the '....' represents the 'counting' part of the question Quote:
ls | sed -n '/[0-9]$/p;/[A-Z]$/p' | .... the '....' represents the 'remove' part of the question Quote:
date '+%b %M %Y' | sed 's/ [0-9][0-9]*$/,&/' Quote:
For the rest..... pls try to find the solution(s) yourself and if you have problems - come back with the specific questions to identify where you're getting stuck [if you are]. |
|
#3
|
|||
|
|||
|
THanks so much for your help. I really appreciate it.
I know its homework, but ive been struggling with it for ages and was totally lost. Thanks again Netrom |
|
#4
|
|||
|
|||
|
thanks for your help.
I know its homework but ive been working on it for ages and was totally stuck. Thanks again. I really appreciate it. Netrom |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Please help! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|