|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Assignment Help
Hi I Am an inexperienced user of unix and have been assigned a coursework which looks at uix command and was looking to see if any experienced users could help. The following commands mut be explained:
1) sed -e 's/$/ /' 2) fold -1 3) sed -e 's/ /*/' 4) awk '{if ( $0 == "*" )printf "\n"; else printf "%s", $0;}' 5) sed -e 's/[[\](){}\!,.;:-]//g' 6) awk '{ if ( $0 == last ) { count = count + 1; } else { printf ": %d\n%s", count, $0; count = 1 }; last = $0} END { printf ": %d\n", count }' If any one could explain what each step would do and the entire process could they please get back to me asap, thanx for taking the time to look at this message |
|
#2
|
||||
|
||||
|
1) search for anything ending in $ and replace it with a period mark.
2) add an extra line to every other line. 3. search for a period and replace it with everything that comes after the period. 4) search for anything that doesn't match anything that previously occured on the last line and replace it with a newline, unless it's at the end of a line. 5) change all punctuation with bias 6) I'll leave that one to you, but the above should help you out a bit.
__________________
FreeBSD Admin Tips Tricks and Scripts |
|
#3
|
||||
|
||||
|
Quote:
Have you tried consulting the man pages on each of these? Whatever happened to people doing the /own/ homework in school? ![]()
__________________
Give a person code, and they'll hack for a day; Teach them how to code, and they'll hack forever. Analyze twice; hack once. The world's first existential ITIL question: If a change is released into production without a ticket to track it, was it actually released? About DrGroove: ITIL-Certified IT Process Engineer - Enterprise Application Architect - Freelance IT Journalist - Devshed Moderator - Funk Bassist Extraordinaire |
|
#4
|
||||
|
||||
|
Quote:
Quote:
On TRU64 UNIX it does not happen. Let us take a file which contains numbers from 1 to 10. Let us name it as "number" Code:
cat number 123 456 78 90 Now if you give Code:
fold -1 number then it gives you one chracter per line. this will be the out put. 1 2 3 4 5 6 7 8 90 |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Assignment Help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|