Generate output file


 
Thread Tools Search this Thread
Operating Systems Linux Generate output file
# 1  
Old 09-10-2014
Generate output file

I would like to generate below one line report to output.txt file using csh.

Code:
   01/01/09 10:15:47|APPL|MD5|ASCII-LF|6480|bal246b61fedf7e07220cedd1a100578

how to make the code to be worked ? Please advise.thanks in advance.

Code:
   #!/bin/csh
   
   a = date 
   set s = '|'
   set b = 'APPL'
   set c = 'MD5'
   set d = 'ASCII-LF'
   e = wc -l 1.txt
   f = md5sum 1.txt
   net = $a$s$b$s$c$s$d$s$e$s$f$e 
   echo $net > output.txt


Last edited by Don Cragun; 09-10-2014 at 01:31 AM.. Reason: Add CODE tags.
# 2  
Old 09-10-2014
Hello balajikalai

What output/errors do you get?



Please use CODE tags to wrap code, files, input & output/errors

Regards,
Robin
# 3  
Old 09-14-2014
i am getting empty output file , Please advise .

basically i wanted to create file audit ,when file created with checksum value.
thanks in advance.
# 4  
Old 09-15-2014
If your shell script has spaces at the start of every line (as shown in the 1st message in this thread, and you are running this script by its name (i.e., not by csh name), then this script will not be executed by csh. Instead, it will be executed by a shell that uses Bourne shell syntax.

I would expect that to generate errors for the unknown commands a, e, f, and net; and then your script would just write a <newline> character into output.txt.

How did you invoke your script?

Did you get any errors while running your script?

Is output.txt really empty (i.e., size 0), or does it contain a <newlne> character?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to generate HTML output format listing like orasnap

Hi, Is there any UNIX scripts out there that generates a listing output of some sort similar to OraSnap At the moment, I have a script that I run on multiple servers that has multiple databases and just querying the database sizes of those databases. It generates a text files that contains... (0 Replies)
Discussion started by: newbie_01
0 Replies

2. Shell Programming and Scripting

Script to generate Excel file or to SQL output data to Excel format/tabular format

Hi , i am generating some data by firing sql query with connecting to the database by my solaris box. The below one should be the header line of my excel ,here its coming in separate row. TO_CHAR(C. CURR_EMP_NO ---------- --------------- LST_NM... (6 Replies)
Discussion started by: dani1234
6 Replies

3. Shell Programming and Scripting

Script To Generate HTML output

Hello All, I need help here with a script. I have a script here which generates a html output with set of commands and is working fine. Now i want to add a new command/function which would run on all the remote blades and output should be included in this html file. Here is the script ... (2 Replies)
Discussion started by: Siddheshk
2 Replies

4. UNIX for Dummies Questions & Answers

LINUX how to generate multiple line output file

Hi All, I am trying to generate a file through a LINUX scripting as shown below export field1=`cat dir/filename1.txt |wc -l` echo "field1 : $field1 >>dir/WeeklySummaryReport.txt export field2=`cat dir/filename2.txt |wc -l` echo "field2 : $field2 >>dir/WeeklySummaryReport.txt While... (5 Replies)
Discussion started by: dsfreddie
5 Replies

5. Shell Programming and Scripting

Linux - Script to generate the output delimited by Comma/Pipe

Hi All, I have a requirement where I need to go to a directory, list all the files that start with person* (for eg) & read the most recent file from the list of files. While browsing through the forum, i found that the command ls -t will list the files. I am trying to generate the output... (1 Reply)
Discussion started by: dsfreddie
1 Replies

6. Shell Programming and Scripting

Read a CSV file and generate SQL output

Friends, This is what I need: I will pass a CSV file as an input, and I want my shell to be reading that CSV file, and based on the parameters it should generate SQLs and write those SQL in a different file in the same location. I'm new to Shell scripting. I'm currently working on a... (25 Replies)
Discussion started by: Ram.Math
25 Replies

7. Shell Programming and Scripting

to read a CSV file and generate SQL output

Friends, This is what I need: I will pass a CSV file as an input, and I want my shell to be reading that CSV file, and based on the parameters it should generate SQLs and write those SQL in a different file in the same location. I'm new to Shell scripting. I'm currently working on a... (1 Reply)
Discussion started by: Ram.Math
1 Replies

8. Shell Programming and Scripting

generate PDF document on UNIX (not with GUI) from SQL*Plus output

Hi I wish to generate from CSV output of SQL*Plus a PDF. I use a Solaris 10 box. Which Open Source software can do that on CLI? (4 Replies)
Discussion started by: slashdotweenie
4 Replies

9. Shell Programming and Scripting

generate tabular output from an input text file in unix shell scripting

Hi, I have the output (as below) which i want it to be in a table. For e.g. space utilization in PSE on path /logs is 0% space utilization in PSE on path /logs/tuxedo/tuxlsp is 16% space utilization in PSE on path /ldvarlsp/lsp/log is 37% space utilization in PSE on path /home is 6%... (7 Replies)
Discussion started by: pkbond
7 Replies

10. Shell Programming and Scripting

need help in Parsing a CSV file and generate a new output file

Hi Scripting Gurus, I am trying to parse a csv file and generate a new output file. The input file will be a variable length in turns of rows and columns. output file will have 8 columns. we have three columns from the header for each set. just to give little bit more clarification each row... (15 Replies)
Discussion started by: vkr
15 Replies
Login or Register to Ask a Question