![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Beginner needs help with script | martyb555 | Shell Programming and Scripting | 2 | 02-16-2008 01:24 PM |
| Beginner Questions | Darin | UNIX for Dummies Questions & Answers | 3 | 07-16-2007 11:47 AM |
| AWK help please - beginner | COLLEGE | UNIX for Dummies Questions & Answers | 4 | 06-13-2007 07:40 AM |
| Beginner C | frustrated1 | High Level Programming | 2 | 05-21-2007 02:14 PM |
| UNIX beginner - I need help please | JennyW | UNIX for Dummies Questions & Answers | 2 | 05-09-2001 08:17 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Please help. I am a beginner.
Alrigt, I need to write a shell script where it counts the number of folders and files and dispays "My home directory has 'x' files and 'y' directories."
So, I was thinking of doing this. set x = `ls | wc` so, if I have 8 files and folders in my home directory, x is not 8. now, I was thinking, of typing ls -p, thus directories are shown with '/' as their last character, so I could get the number of directories by 'grep'ing the words that contain '/' as their last character and se that value as y. That is the number of directories. Next is files, which is easy, just x-y. But now, for the y value, what do I type? I have been trying a bounch of commands but I cannot get it to work. Thank you for your time. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|