i writing a unix script but i want to out put a file and append on it.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting i writing a unix script but i want to out put a file and append on it.
# 1  
Old 08-14-2012
i writing a unix script but i want to out put a file and append on it.

i have an existing script that is used to send an e-mail containing the alrams that appear on the server.
But i need to create a daily log file containing all the alarms that was send that day.

i tired to add at the and of the script a command, echo command but for some reason the file was never created can any one help plz Smilie


echo $x >> alarms_export_date.txt


echo $x >> alarms_export_`date +%Y-%m-%d`.txt

were x is the variable that contains the alarm.
# 2  
Old 08-14-2012
Show more of the script. It's possible it exits before then.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

UNIX script to append multiple text files into one file based on pattern present in filaname

Hi All-I am new to Unix , I need to write a script. Can someone help me with a requirement where I have list of files in a directory, I want to Merge the files if a pattern of string matches in filenames? AAAL_555A_ORANGE1_F190404.TXT AAAL_555A_ORANGE2_F190404.TXT AAAL_555A_ORANGE3_F190404.TXT... (6 Replies)
Discussion started by: Shankar455
6 Replies

2. Programming

Writing a UNIX shell script to call a C function and redirecting data to a .txt file

Hi, I am complete new to C programming and shell scripting. I just wrote a simple C code to calculate integral using trapezoid rule. I am prompting user to pass me No. of equally spaced points , N , upper and lower limit. My code looks as follows so far: #include<stdio.h> #include<string.h>... (2 Replies)
Discussion started by: bjhjh
2 Replies

3. Shell Programming and Scripting

How to generate HTML page from UNIX script out-put?

Hi All. This my first post to this forum, and i assuming it will be best out-of all. I am quite new to Unix scripting so please excuse me for any silly questions - I am trying to create on Unix script in which it telnet to my server, check the connectivity of the server and then it... (2 Replies)
Discussion started by: HHarsh
2 Replies

4. Shell Programming and Scripting

Unix Script file to Append Characters before rows in file.

Hi Experts, I am working on HP-UX. I am new to shell scripting. I would like to have a shell script which will prefix: 1. "H|" before first row of my file and, 2. "T" for all other rows of the file. For Example - File before running the script 20100430|4123451810|218.50|TC 20100430 ... (4 Replies)
Discussion started by: phani333
4 Replies

5. Shell Programming and Scripting

Pointers on writing a unix script

Hi All, I am writing a unix shell script. I have a file called Results.txt which stores 4 fields separated by pipe. i.e. a pipe delimited file. I want to loop through each record of this file and store each of these 4 fields into variables. I have read can be done through awk but I have never... (7 Replies)
Discussion started by: shwetainnani
7 Replies

6. Shell Programming and Scripting

need help writing this unix script

Create an executable script file called "newname" that will perform the followings: 1. Rename a file upon the user's request. If the file exists, prompt the user for confirmation before renaming the file. The screen should prompt the user for a. "Name of file you want to rename." Use the "\c"... (7 Replies)
Discussion started by: wiggles
7 Replies

7. Shell Programming and Scripting

help writing this unix script

I am working on writing scripts. Here is a script I need help with. I have also wrote what I think it is. I would really appreciate any help that I can get. Create an executable script file called "newname" that will perform the followings: 1. Rename a file upon the user's request. If the... (2 Replies)
Discussion started by: wiggles
2 Replies

8. HP-UX

to put the unix script output on windows desktop

Hi could you pls guide a to automate that unix script output is avaialble on desktop.i can FTP and then download but i want to automate it. rgds (1 Reply)
Discussion started by: Assassin
1 Replies

9. Shell Programming and Scripting

Need help in writing a unix script

OS: Solaris Shell : KSH Please help me in writing a script that captures a error message from a log file ( which updates continiously ) and send an email alert as soon as the systems throws a error message into that log. i.e With out monitoring the log Thanks in advance.. (1 Reply)
Discussion started by: pray44u
1 Replies

10. UNIX for Dummies Questions & Answers

How to copy data file from UNIX and put it on PC

Hello, My customer wants me to copy a data file from his UNIX box, and transfer to windows basic PC. My question is how can I find the file in UNIX box, copy it out into DOS/Windows format. Please help. Thanks (3 Replies)
Discussion started by: BillyT
3 Replies
Login or Register to Ask a Question