How do I stop printf output from going into seperate txt files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How do I stop printf output from going into seperate txt files
# 8  
Old 07-26-2006
Here is some sample output

I hope this posts correctly

Code:
chris.domain.com/web_users/chris2/red                                            5   Jul-25-03:06   99e4e22dda38bc735e56341dedcf4ba5  
chris.domain.com/web_users/chris2/best                                         311   Jul-18-17:17   35c1b42c2540e869fc55fafab0140895  
chris.domain.com/web_users/chris2/new/yellow                                     7   Jul-25-03:07   51b19ed7e4dcad54b0a16d6cd3d4b92f  
chris.domain.com/web_users/chris2/new/new                                        7   Jul-25-03:06   3af0030870e2e4ec46cb625215323728  
chris.domain.com/web_users/chris2/new/hello                                      5   Jul-25-03:10   a91520833605d8d629b47f8ac6a8a13e  
chris.domain.com/web_users/chris2/wantstochat_long.wav                       85306   Jul-25-00:20   ab7a1ff08327366c8026c231ce69a8d4  
chris.domain.com/web_users/chris2/urlruby.txt                                  188   Jul-25-00:20   939d9705b71a06f0c863501f97ca7344  
chris.domain.com/web_users/chris2/im444333444.txt                            34353   Jul-25-00:21   a84ff6f68d9d7842d1eb15708c5b69a6  
chris.domain.com/web_users/chris2/im444.txt                                  12709   Jul-25-00:21   b8800324670b6052148f6c72673b6862  
chris.domain.com/web_users/chris2/test                                         207   Jul-20-20:50   f94739cbec5315f24b739cd5924e6610  
chris.domain.com/web_users/chris2/rest                                           339   Jul-20-17:04   8dff310f9fdce8ec636857e589240487  
chris.domain.com/web_users/chris2/sea                                            510   Jul-25-03:15   9259b0e3e1102c1f6bcce0e0715f740f  
chris.domain.com/web_users/chris2/me                                             177   Jul-25-00:58   d97ad3f9138b6a8fa1e1e401f2571851  
chris.domain.com/web_users/chris2/lake                                           468   Jul-25-01:47   9261182605cd9549f6a88697dc40abca  
chris.domain.com/web_users/chris2/red                                              5   Jul-25-03:06   99e4e22dda38bc735e56341dedcf4ba5  
chris.domain.com/web_users/chris2/best                                           311   Jul-18-17:17   35c1b42c2540e869fc55fafab0140895  
chris.domain.com/web_users/chris2/new/yellow                                       7   Jul-25-03:07   51b19ed7e4dcad54b0a16d6cd3d4b92f  
chris.domain.com/web_users/chris2/new/new                                          7   Jul-25-03:06   3af0030870e2e4ec46cb625215323728  
chris.domain.com/web_users/chris2/new/hello                                        5   Jul-25-03:10   a91520833605d8d629b47f8ac6a8a13e  
chris.domain.com/web_users/chris2/wantstochat_long.wav                         85306   Jul-25-00:20   ab7a1ff08327366c8026c231ce69a8d4  
chris.domain.com/web_users/chris2/urlruby.txt                                    188   Jul-25-00:20   939d9705b71a06f0c863501f97ca7344  
chris.domain.com/web_users/chris2/im444333444.txt                              34353   Jul-25-00:21   a84ff6f68d9d7842d1eb15708c5b69a6  
chris.domain.com/web_users/chris2/im444.txt                                    12709   Jul-25-00:21   b8800324670b6052148f6c72673b6862


Last edited by reborg; 07-26-2006 at 05:30 PM..
# 9  
Old 07-26-2006
Ok that didn't work, does anyone have any suggestions about the best way to post this?

Do i need to quote each line?
# 10  
Old 07-26-2006
I've edited you post to uses code tags, that's the easiest way.

Try removing the spaces in your printf statement.
Code:
printf "%-75s%+10s%5s%1s\n" $s $z $x $y >> status

# 11  
Old 07-26-2006
I found out the mail format was exactly the way I wanted it. My email client was not showing true text. So I had to set it to show the original format. I can't believe I spent 3 days debugging a script and it didn't need it, or at least that part.

Thanks for all your help

Chris
# 12  
Old 07-26-2006
I actually do have one last question, is there a way to specify a different email address than the user thats logged in in this command. A From Field?


Code:
mail -s "Uploads!" -c "$email" susant <  status

If not what would be the equivilant sendmail command?

thank you
chris
# 13  
Old 07-26-2006
Yes, just put a line with:

From: <sender>

at the start of the status file, and it should override the username. If you are unsure of the exact format it should have, just veiw the header of an email you have received and look for that line, and copy its format.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

For loop for seperate files

For shell script. If I had two separate files, file.txt and file1.txt and each has just a list of names from the who command. How would I create an if loop to compare each name? (1 Reply)
Discussion started by: Eric7giants
1 Replies

2. Shell Programming and Scripting

Desired output.txt for reading txt file using awk?

Dear all, I have a huge txt file (DATA.txt) with the following content . From this txt file, I want the following output using some shell script. Any help is greatly appreciated. Greetings, emily DATA.txt (snippet of the huge text file) 407202849... (2 Replies)
Discussion started by: emily
2 Replies

3. Shell Programming and Scripting

Compare two txt files,mismatches will be in new txt files

Hi, Below are the sample data for txt files. txt file 1 Partnumber|catgroup_id 10001082|46016 10001093|4680 10001093|386003 10001093|463004 10003251|683 10003251|63005 10003252|463005 10003252|4683 10003260|463005 10003260|4683 10003264|4683 10003264|463005 13420000|67... (5 Replies)
Discussion started by: Ankita Talukdar
5 Replies

4. Shell Programming and Scripting

printf Hexadecimal output

printf "%X\n" "A" 41 printf "%X\n" "2" 2 Expected 32 (not 2). Is there a "printf" which will output the hexadecimal value of a numeric character? (9 Replies)
Discussion started by: methyl
9 Replies

5. Solaris

list files .txt and .TXT in one command

Dear experts, In a directory i have both *.TXT and *.txt files. I have a script- for file in `ls *.txt`; do mv $file /tmp/$file How to list both *.txt and*.TXT file in one command so that script will move both .txt or .TXT whatever it find. br//purple (4 Replies)
Discussion started by: thepurple
4 Replies

6. UNIX for Advanced & Expert Users

Help please...output problems with printf.

#include <stdio.h> #include <math.h> // this function calculates the volume of a Cylinder int main(void) { int r; // radius int h; // height double M_PI; // pi int pOne = pow (r, 2); // get user input of radius and height printf ("Enter your... (3 Replies)
Discussion started by: pwanda
3 Replies

7. UNIX for Dummies Questions & Answers

comparing strings in seperate files

Hello, I am comparing files with for mismatches using fgrep but I've run into a problem. fgrep -vf $file1 $file2 > mismatches.dat file1 and file2 both contain file names on each line file1 has filenames which are up to 92 characters long and contain the "$" char. example file name:... (2 Replies)
Discussion started by: orahi001
2 Replies

8. Shell Programming and Scripting

Split File into seperate files

Hi, So I have a text file which I want to separate into separate text files. I would use the split command but the problem here is that the text file is separated by delimiters. For example: blah blah blah ------ more text ----- and some more text So basically the first part should be... (4 Replies)
Discussion started by: eltinator
4 Replies

9. Shell Programming and Scripting

Email like files in seperate emails

My goal is to send multiple files to a person based on their input. The files have similar names like: file1-egress-filter file2-ingress-filter stuff1-egress-filter stuff2-ingress-filter ... The script is run with the filename given as arguments, such as: ./mail.sh file stuff would... (6 Replies)
Discussion started by: earnstaf
6 Replies

10. Shell Programming and Scripting

Sorting problem "sort -k 16,29 sample.txt > output.txt"

Hi all, Iam trying to sort the contents of the file based on the position of the file. Example: $cat sample.txt 0101020060731 ## Header record 1c1 Berger Awc ANP20070201301 4000.50 1c2 Bose W G ANP20070201609 6000.70 1c2 Andy CK ANP20070201230 28000.00... (3 Replies)
Discussion started by: ganapati
3 Replies
Login or Register to Ask a Question