#1  
Old 20th October 2010, 15:53
KenzoIT KenzoIT is offline
Junior Member
 
Join Date: Dec 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default The number of files.

Hi all,

My folder have some files and I want to show the number of files on folder at "There are : " line.

This is my code :

#!/bin/sh

if [ -d /home/kenzo/Monday/ ] && {
echo "Monday"
ls -l /home/kenzo/Monday/
};then
echo "================================================= ==="
echo "There are : "

else
echo -e "Folder of Monday not find."
echo "================================================= ==="
fi
exit 0

The script work well but it doesn't show the number of files at "There are : " line.

Is it possible, pls intruct me how to do it.
Thanks !
Reply With Quote
Sponsored Links
  #2  
Old 21st October 2010, 00:11
BorderAmigos BorderAmigos is offline
Senior Member
 
Join Date: Apr 2008
Location: San Diego & Tijuana
Posts: 302
Thanks: 26
Thanked 33 Times in 31 Posts
Send a message via MSN to BorderAmigos Send a message via Yahoo to BorderAmigos
Default

echo "There are : "
ls -1 /home/kenzo/Monday/
else


^^^ Add the line in the middle.
__________________
System6Hosting.com, ISPConfig 3, Debian.
Reply With Quote
The Following User Says Thank You to BorderAmigos For This Useful Post:
PlaybookTips (29th October 2010)
  #3  
Old 21st October 2010, 15:28
KenzoIT KenzoIT is offline
Junior Member
 
Join Date: Dec 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

Monday folder have four files.
I tested as your instruction but it doesn't show files at the line.
(There are : 4 files on folder. )

Anyone help me how to fix it ?
Thanks all !
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ISPCONFIG 3 Email Content Filter jariasca Installation/Configuration 11 2nd August 2012 12:27
Debian 5.0 'hangs' GHz Installation/Configuration 5 1st October 2009 12:57
Apache wont serve my files anymore:( wotIsCmd Server Operation 2 17th July 2009 20:24
The system is currently updating the configuration files. warlock General 8 21st February 2009 18:15
Can't start apache Musty Server Operation 12 9th March 2008 13:58


All times are GMT +2. The time now is 19:28.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.