|
|
![]() |
|
|
Top | #1 |
|
Unregistered
Posts: n/a
|
|
|
|
|
Top | #2 |
|
Unregistered
Posts: n/a
|
here are the questions for ya...im stumped
1)the command "dirname path" treats path as a pathnameand writes to the standard output the path prefix, that is everything up to but not including the last component. thus "dirname a/b/c/d" write a/b/c to standard output. If path is simple filename (has no / characters), then dirname writes a . to standard output. Implement "dirname" as a Korn Shell function. Make sure that it behaves sensibly when given values of path such as /. 2)implement the basename utility, which writes the last component of its pathname argument to standard output, as a Korn Shell function. For example basename a/b/c/d writes d to standard output. 3) The UNIX basename utility has an optional third argument. If you type suffix of path that is identical to suffix. For example $ basename src/shellfiles/prog.sh .sh prog $ basename src/shellfiles/prog.sh .c prog.sh add this feature to the function you wrote for problem 2. |
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help need to print off my son's homework | kev59 | Green Room | 5 | March 16th, 2004 5:55pm |
| Some UNIX responses to some UNIX commands: | Geffy | Funny Farm | 2 | March 8th, 2004 11:25pm |
| Merging two .html files : Homework | lieb39 | Web Design & Coding | 6 | September 16th, 2003 1:56am |
| History Homework : Please help ! | ZAnwar | Green Room | 48 | September 26th, 2002 10:12pm |
| which UNIX o/s ? | SPeedY_B | Linux & BSD | 17 | September 26th, 2002 2:05am |