Creating multiple extensions


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Creating multiple extensions
# 1  
Old 06-23-2008
Creating multiple extensions

Friends

I want to automat sending a letter to different persons whose directories are named as 001, 002, 003, 004.

To push the same letter to all these directories, I need to name the letter as letter.001, letter.002 like that.

Is there any method whereby I get the extension of this letter as myletter.001, myletter.002 etc.

Please help and thanks in advance

sastry
# 2  
Old 06-23-2008
Hammer & Screwdriver Here is a start; was nto sure of all requirements

Code:
> cat seq_nmbr_mail 
#! /bin/bash

count=001
max_count=025
while [ $count -le $max_count ]
   do
   countt=$(printf "%.3d" "$count")
   echo $countt
#insert commands to do for every iteration here
   cp demo_letter letter."$countt"
#  mailx -s "Important Notice" person@xyz.com <<letter."$countt"
   count=$((count+1))
done

# 3  
Old 06-24-2008
Creating multiple extensions

Thanks a lot.

The requirement is like this.
At regular intervals I need to send a letter to all my clients. They are identified with 001, 002, 003....... I would like to send a letter viz. myletter.doc to all of them. For automating I need to create an extension like myletter.doc.001, 002..... so that they can be pushed to respective directories.

thanks once again.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

List directory name (only once) after multiple file extensions found

Here is a simplified example of my problem. Say I have the following 3 sub-directories; ./folder1 A.txt A.sh ./folder2 B.txt ./folder3 C.txt C.sh I would like to list the directory names which contain both '.txt' & '.sh' type extensions. I have came up with the following code;... (8 Replies)
Discussion started by: mmab
8 Replies

2. Shell Programming and Scripting

Replacing multiple extensions

HI, I have some csv files with mutiple extensions, I want to remove all the extensions and keep only the .csv extension. anybody can suggest me how to do this. source files 1.txt.csv.txt.csv.csv.txt.csv 2.csv.txt.csv.txt.csv.txt target 1.csv 2.csv --Wang (1 Reply)
Discussion started by: wangkc
1 Replies

3. Debian

How to Excluding Extensions Creating RAR & Uploading it

for media files in directory i want change every special char in name to "_" , create screenshots, get media information, then cat that info in 1 file, after that i want split (only) media files (not *.jpg,*.txt, etc.) with rar (including some file with info in each archive, and give each archive... (7 Replies)
Discussion started by: sunnymuffin
7 Replies

4. Programming

Creating Multiple Processes

I am having problems creating multiple forks. I want create a certain number of forks, each call a program and each wait for a different value. How is this accomplished my loop is not doing the trick. for (i = 0; i < 5; i++) { if (fork() < 0) { //print error } ... (3 Replies)
Discussion started by: Vikings1201
3 Replies

5. UNIX for Dummies Questions & Answers

changing extensions for multiple files at once

I copied some files to another folder, and I want to change them from .doc extensions to .txt extensions. I tried using the cp and mv commands, but it didn't work. Is it possible to change file extensions with these commands, and if so how do I do it? I tried using the * wildcard (say cp *.doc... (1 Reply)
Discussion started by: Straitsfan
1 Replies

6. Shell Programming and Scripting

Stripping out extensions when file has multiple dots in name

I posted this already in another thread, but was told that I should create a seperate thread for the following question: How do I strip the extension when the delimiter might occur multiple times in the filename? For example: I have 2 files as input for my script. test.extension... (8 Replies)
Discussion started by: Nemelis
8 Replies

7. Shell Programming and Scripting

Truncate multiple file extensions

Hi, I have files with names like file1.txt.txt.txt.txt and file2.txt.txt.txt.txt.txt............ (random infinite number of .txt exist). how to truncate (mv) their names to ones with single .txt extension like file1.txt and file1.txt ? In other words, how to extract the filename upto first... (12 Replies)
Discussion started by: prvnrk
12 Replies

8. Shell Programming and Scripting

creating multiple links with ln

I want to make a symbolic link to a set of files in a particular directory if they exist. The number of files in the set is not known. The following script fails because it is ambigious. if(-f dir1/*.a) then ln -s dir1/*.a dir2/ endif Can anyone help me? Thanks a lot. (1 Reply)
Discussion started by: Deanne
1 Replies

9. Shell Programming and Scripting

Creating multiple sessions

I have a program which gets an input file (which contain a list of objects) and processes the objects one by one sequentially. However when there are many objects it is faster to split the input into smaller lists and run the program in multiple terminal sessions simultaneously. I want to know if... (2 Replies)
Discussion started by: stevefox
2 Replies

10. Shell Programming and Scripting

find -regex: matching multiple extensions

I want to use find to locate files with two different extensions, and run a grep on the results. The closest I have gotten is incredibly slow and ugly: for i in `ls -laR|egrep -e '(.js|.css)'`; do find . -name $i -print|xargs grep -H searchBg; done; This method makes my eyes bleed. Help! ;) ... (2 Replies)
Discussion started by: r0sc0
2 Replies
Login or Register to Ask a Question