Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Getting all file names in a folder. Post 3305 by adadevil on Thursday 28th of June 2001 01:29:34 PM
Old 06-28-2001
Error Getting all file names in a folder.

Hi All,
I need help to create a shell script that does following:

- do ls -1 and let all file names in the current folder
- do wc for each file and if wc > 0 then send a mail.

I am new to unix and do not know how to get filename one by one in a loop, so that wc can be done. I have done rest of the things but just looping all files is left.

Please help!

Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Working with folder names

I have the following directory structure: /maindir /maindir/product1/ /maindir/product1/type1 /maindir/product1/type2 /maindir/product1/type3 /maindir/product2/ /maindir/product2/type1 /maindir/product2/type2 /maindir/product2/type3 /maindir/product2/type4 ... I'm able to traverse... (6 Replies)
Discussion started by: ricksj
6 Replies

2. Shell Programming and Scripting

Script to move files with similar names to folder

I have in directory /media/AUDIO/WAVE many .mp3 files with names like: my filename_01of02.mp3 my filename_02of02.mp3 Your File_01of06.mp3 Your File_02of06.mp3 etc.... In the same directory, /media/AUDIO/WAVE, I have many folders with names like 9780743579490 9780743579491 etc.. Inside... (7 Replies)
Discussion started by: glev2005
7 Replies

3. Shell Programming and Scripting

editing names of files in multiple folder

I have 1000's of directories which is named as numbers. Each directory contains multiple files. Each of these directories have a file named "att". I need to rename all the att files by adding the directory name followed by "_" then att for each of the directories. Directories 120 att... (2 Replies)
Discussion started by: Lucky Ali
2 Replies

4. Shell Programming and Scripting

Renaming File Names in a folder/Dir

Hi Team, I'm new to Unix shell scripting . I've the following requirement A folder contains the list of files with the following format ab.name.11.first ab.name.12.second ab.name.13.third ---------- I have to rename the above file to like below ... (6 Replies)
Discussion started by: smile689
6 Replies

5. Shell Programming and Scripting

Bash script for printing folder names and their sizes

Good day, everyone! I'm very new to bash scripting. Our teacher gave us a task to create a script that basically does the same job the 'du' command does, with the difference that 'du' command gives an output in the form of <size> <folder name>and what we need is <folder name> <size>As for... (1 Reply)
Discussion started by: UncleIS
1 Replies

6. Homework & Coursework Questions

Bash script for printing folder names and their sizes

1. The problem statement, all variables and given/known data: The task is to create a script that would reproduce the output of 'du' command, but in a different way: what 'du' does is: <size> <folder name>and what is needed is <folder name> <size>We need to show only 10 folders which are the... (3 Replies)
Discussion started by: UncleIS
3 Replies

7. Shell Programming and Scripting

Remove trailing space from file and folder names

I have a folder that contains many sub folders and files. This tree has to be backed up to an archive system. According to the tech support, one of the archives is failing to back up due to the possibility of trailing spaces on file and folder names. Therefore, I would like to have a script... (16 Replies)
Discussion started by: vipertech
16 Replies

8. Shell Programming and Scripting

Checking Multiple File existance in a UNIX folder(Note: File names are all different)

HI Guys, I have some 8 files with different name and extensions. I need to check if they are present in a specific folder or not and also want that script to show me which all are not present. I can write if condition for each file but from a developer perspective , i feel that is not a good... (3 Replies)
Discussion started by: shankarpanda003
3 Replies

9. Shell Programming and Scripting

Exclude certain file names while selectingData files coming in different names in a file name called

Data files coming in different names in a file name called process.txt. 1. shipments_yyyymmdd.gz 2 Order_yyyymmdd.gz 3. Invoice_yyyymmdd.gz 4. globalorder_yyyymmdd.gz The process needs to discard all the below files and only process two of the 4 file names available ... (1 Reply)
Discussion started by: dsravanam
1 Replies

10. Shell Programming and Scripting

Script to tar/rsync/rm multiple folder names

hi all, i attach a link with what im trying to do automatically via script but i have some questions i need answering please, bear in mind i am really new to bash scripting, the only thing i know how to do is commands in scripts like cd rm tar rsync cp stuff like that i have mutiple project... (48 Replies)
Discussion started by: robertkwild
48 Replies
mh(1mh) 																   mh(1mh)

Name
       mh - introduction to MH

Description
       MH  is  the  name  of a powerful message handling system.  Rather than being a single comprehensive program, MH consists of a collection of
       fairly simple single-purpose programs to send, receive, save, and retrieve messages.  Refer  to	the  individual  MH  reference	pages  for
       descriptions of the programs that make up MH.

       Unlike  MH  is  not  a  closed system which must be explicitly run, and then exited when you wish to return to the shell.  Instead, you may
       freely intersperse MH commands with other shell commands.  This allows you to read and answer your mail while you have (for example) a com-
       pilation running, or are searching for a file or running programs to find an answer to someone's question before replying to them.

       To get started using MH, add the directory to your $PATH.  This is best done in one of the files or in your home directory.  Check the man-
       ual entry for the shell you use if you do not know how to do this.  Run the command.  If you have never used MH before, it creates the nec-
       essary  default files and directories after asking you if you wish it to do so.	The command moves mail from your system maildrop into your
       MH folder.  Each message is converted to MH format, and stored as separate files in your folder until you have read it.	When you have read
       a message, you can refile it in another folder that you have created.

       Folders are directories in which messages are stored: the folders themselves are stored in your Mail directory.	See and for more details.

       For  each  message it processes, prints a one-line display.  The one-line display contains the From: field, the Subject: field, and as much
       of the first line of the message as it can accommodate.	The first message that processes becomes your current message.	 All  MH  commands
       operate on the current message unless you have specified the msg argument.

       You need to run each time you wish to incorporate new mail into your folder.

       The command prints a list of the messages in your current folder.

       The commands and are used to read specific messages from the current folder.  Of these, displays the current message.  You can also display
       a specific message by specifying its number.  In the following example, the mail system displays the contents of message number 10  in  the
       current folder:
       % show 10

       The  commands and display the message numerically following and numerically preceding the current message, respectively.  In all cases, the
       message displayed becomes the current message.  If there is no current message, may be called with an argument, or may be used  to  advance
       to the first message.  The command (remove message) deletes the current message.

       You  can  delete  messages other than the current message by specifying the message number or numbers.  When you specify more than one mes-
       sage, you separate each message number by a space.  In the following example, messages 2, 4 and 6 in the current folder are deleted:
       % rmm 2 4 6

       The command is used to reply to a message.  It places you in the editor with a prototype response form.	While you are in the  editor,  you
       may view the item you are responding to by reading the file

       The command allows you to compose a message by putting you in the editor on a blank message header form, and then lets you send it.

       All  the  MH  commands may be run with the single argument -help, which causes them to print a list of the arguments with which they may be
       invoked.

       Commands which take a message number as an argument (for example) also take one of the following keywords:

       first	 The first message in the current folder.

       last	 The last message in the current folder.

       cur	 The current message in the current folder.

       prev	 The previous message in the current folder.

       next	 The next message in the current folder.

       Commands which take a range of message numbers, such as or also take any of the following abbreviations:

       num1-num2 Indicates all messages in the range num1 to num2, inclusive.  The specified range must contain at least one message.

       num:+n
       num:-n	 Up to n messages beginning with (or ending with) message num.	The value of num may be any of the MH message keywords: or

       first:n
       prev:n
       next:n
       last:n	 The first, previous, next or last n messages, if they exist.

       There are many other possibilities, such as creating multiple folders for different topics, and automatically refiling  messages  according
       to subject, source, destination, or content.  See the individual reference pages for more details of the rest of the MH commands.

       Following is a list of all the MH commands:

       alex(1mh)	 extract addresses from message headers
       ali(1mh) 	 list mail aliases
       anno(1mh)	 annotate messages
       burst(1mh)	 explode digests into messages
       comp(1mh)	 compose a message
       dist(1mh)	 redistribute a message to additional addresses
       folder(1mh)	 set/list current folder/message
       folders(1mh)	 list all folders
       forw(1mh)	 forward messages
       inc(1mh) 	 incorporate new mail
       mark(1mh)	 mark messages
       mhl(1mh) 	 produce formatted listings of MH messages
       mhmail(1mh)	 send or read mail
       mhpath(1mh)	 print full pathnames of MH messages and folders
       msgchk(1mh)	 check for messages
       msh(1mh) 	 MH shell
       next(1mh)	 show the next message
       packf(1mh)	 compress a folder into a single file
       pick(1mh)	 select messages by content
       prev(1mh)	 show the previous message
       prompter(1mh)	 prompting editor front end
       rcvstore(1mh)	 incorporate new mail asynchronously
       refile(1mh)	 file messages in other folders
       repl(1mh)	 reply to a message
       rmf(1mh) 	 remove folder
       rmm(1mh) 	 remove messages
       scan(1mh)	 produce a one line per message scan listing
       send(1mh)	 send a message
       slocal(1mh)	 receive mail hooks
       show(1mh)	 show (list) messages
       sortm(1mh)	 sort messages
       whatnow(1mh)	 prompting front-end for send
       whom(1mh)	 report who will receive a message when it is sent

       mh-alias(5mh)	 alias file for MH message system
       mh-format(5mh)	 format file for MH message system
       mh-mail(5mh)	 message format for MH message system
       mh_profile(5mh)	 user customization for MH message system
       mtstailor(5mh)	 system customization for MH

       ap(8mh)		 parse addresses RFC 822-style
       conflict(8mh)	 search for alias/password conflicts
       dp(8mh)		 parse dates RFC 822-style
       install-mh(8mh)	 initialize the MH environment
       post(8mh)	 deliver a message

Files
       Directory containing commands

       MH library

																	   mh(1mh)
All times are GMT -4. The time now is 11:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy