Get the return log file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Get the return log file
# 1  
Old 01-26-2007
Get the return log file

I have an execution in my shell script when run return a xxx.log file
how wil i be able to get the name of the file and read it then test the string written in the file by the programs...
Anyone can help me please...
Am new to shell programming......


Lutchumaya
# 2  
Old 01-26-2007
you want to write to logfile inside script.

just redirect your output as below.

echo "test" > logout.txt (output redirection)
cat logout.txt (will show you the contents of the text file you can pipeit "|" and give input to other commands if needed.)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Return: can only `return' from a function or sourced script

Not sure where the problem is. I can run the script without any issue using the following command. . /opt/app/scripts/cdc_migration.sh But it fails with the below error when I try it this way /opt/app/scripts/cdc_migration.sh /opt/app/scripts/cdc_migration.sh: line 65: return: can only... (1 Reply)
Discussion started by: svajhala
1 Replies

2. UNIX for Advanced & Expert Users

File command return wrong filetype while file holds group separator char.

hi, I am trying to get the FileType using the File command. I have one file, which holds Group separator along with ASCII character. It's a Text file. But when I ran the File command the FileType is coming as "data". It should be "ASCII, Text file". Is the latest version of File... (6 Replies)
Discussion started by: Arpitak29
6 Replies

3. Shell Programming and Scripting

Remove Line Return from the File

Hi, I have an output file like this and after the third record a blank line is getting displayed and i want to remove that. I have been looking at the forums and was trying sed and tr options but unable to make it work. I still see a blank line getting displayed in the output. Please help. ... (9 Replies)
Discussion started by: sudhagk
9 Replies

4. Shell Programming and Scripting

Get the log and return the right value

Hi expert, I'm a tester, I want to write a function with bash to collect log which the command I run. the log contains the "shell prompt---> root@intel_5500_server:, and the last whole command in the shell ----> such as "cd /root/;ls |grep .sh" to be clear it should be sommething like ... (9 Replies)
Discussion started by: yanglei_fage
9 Replies

5. Shell Programming and Scripting

Writing a UNIX script from LOG to provide return code.

Folks - Firstly, I do apologize that my first post here is a question. I am quite familiar with UNIX since our application is running on it. We are trying to automate a few things on our end and I am challenged with a task in hand that requires UNIX scripting. I am totally a newbie in UNIX... (4 Replies)
Discussion started by: sk72
4 Replies

6. Shell Programming and Scripting

Reading file and return value

Hi guys, I am newbie in unix, so I need your help. I need to right unix function code that can read sample.txt. If sample.txt contains sentence such as "Error due to syntax." then it will return value. I tried below code, but I got errors. if then echo " There are... (4 Replies)
Discussion started by: adamenderik
4 Replies

7. UNIX for Dummies Questions & Answers

Search for String within File and Return File Name

How do I search for a string within a file and return the names of the file that contain the string? I would like to search directories and sub-directories. (4 Replies)
Discussion started by: bggibson
4 Replies

8. UNIX for Dummies Questions & Answers

to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 's

Hi All, Can anyone please let me know the syntax / how to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 'system()' function and '${?}'. I am in a process to send the mail automatically with an attachment to bulk users. I have used 'Mailx' and 'Unencode'... (0 Replies)
Discussion started by: manas6
0 Replies

9. Shell Programming and Scripting

Return a message when a file is not found

Hi there, I am writing a script to look for tmp log files that have not been access within the last 10 days. I am using the follwing command within the script: find /var/tmp -name *log -atime -9 ¦xargs What I would like to be able to do would be to display a message if there is no... (3 Replies)
Discussion started by: lodey
3 Replies

10. Solaris

/var/cron/log Return Codes

I want to know if there is any documentation or any type of information that can give a list of all of the return codes that can be seen in the /var/cron/log. I have seen a couple in my log file. Example: rc=1 and rc=64. (2 Replies)
Discussion started by: sjames
2 Replies
Login or Register to Ask a Question