Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Cat Input & Output to a Log file Post 302880279 by RudiC on Wednesday 18th of December 2013 01:46:29 PM
Old 12-18-2013
Try this (but you won't see what you type);
Code:
exec 5>&1 6>&2 >&a.log
cat a.txt
exec  1>&5 2>&6

This saves stdout and stderr to some dummy file descriptors, redirects them to x.log, and later restores them from the dummies.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

for i in `cat myname.txt` && for y in `cat yourname.txt`

cat myname.txt John Doe I John Doe II John Doe III ----------------------------------------------------------------------- for i in `cat myname.txt` do echo This is my name: $i >> thi.is.my.name.txt done ----------------------------------------------------------------------- cat... (1 Reply)
Discussion started by: danimad
1 Replies

2. Shell Programming and Scripting

how to input the CAT command output in Shell

Hi guys... I am new to this scripting...so please forgive me if anything worng in my questions... here is my question.. I have file structure /home/oracle/<sid>/logs/bkup now i want to write a script which should grep the sid name from a file..and it should replace the <SID> with... (1 Reply)
Discussion started by: troubleurheart
1 Replies

3. Shell Programming and Scripting

cat file and parse output

Hello, I'm new to shell scripting and did a search on the forum to what I want to do but couldn't find anything. I have about 9 routers that outputs to 1 syslog file daily named cisco.year.mo.date.log ex: cisco.2009.05.11.log My goal is to make a parsing script that cats today's syslog... (2 Replies)
Discussion started by: jjrambar
2 Replies

4. Shell Programming and Scripting

Dynamic output file generation using a input text file with predefined output format

Hi, I have two files , one file with data file with attributes that need to be sent to another file to generate a predefined format. Example: File.txt AP|{SSHA}VEEg42CNCghUnGhCVg== APVG3|{SSHA}XK|"password" AP3|{SSHA}XK|"This is test" .... etc --------- test.sh has... (1 Reply)
Discussion started by: hudson03051nh
1 Replies

5. UNIX for Dummies Questions & Answers

Unable to copy file using SCP (Input/output & Permission denied error)

Hi, I am facing issue while using scp. Source & target machines are Linux & HP-UX respectively. On target machine, if I fire the following command, I get error: Now if I try scp on another file, which is on the same source machine, it works fine. All directories and subdirectories... (2 Replies)
Discussion started by: Technext
2 Replies

6. UNIX for Dummies Questions & Answers

Cat command drops lines in output file

I use the cat command to concatenate text files, but one of the rows I was expecting doesn't display in the output file. Is there a verbose mode\logging mechanism for the cat command to help me investigate where the lines I was expecting are going?? cat 7760-001_1_*_06_*.txt | grep -v... (1 Reply)
Discussion started by: Xin Xin
1 Replies

7. Shell Programming and Scripting

Cat writing only one record in the output file

Hi All, I have an input file containing data as below: Input.DAT XXXXXXX|YYYYYYY|ZZZZZZZZZZ|12334446456|B|YY|111111111|111111111|111111111|111111111|15|3|NNNNNN|Y|3|AAA|111111111... (11 Replies)
Discussion started by: sagar.cumar
11 Replies

8. Shell Programming and Scripting

Getting output from a file similar to cat output

I have a file # cat /root/llll 11 22 33 44 When I cat this file content to a variable inside a shell script and echo that shell script, it does not show up as separate lines. I need echo output similar to cat. cat /root/shell_script.sh #!/bin/bash var=`cat /root/llll` echo $var (2 Replies)
Discussion started by: anil510
2 Replies

9. Shell Programming and Scripting

Ssh cat file output into a file on local computer

Hello, I'm on a remote computer by SSH. How can I get the output of "cat file" into a file on the local computer? I cannot use scp, because it's blocked. something like: ssh root@remote_maschine "cat /file" > /locale_machine/file :rolleyes: (2 Replies)
Discussion started by: borsti007
2 Replies

10. UNIX for Beginners Questions & Answers

Print Error in Console and both Error & Output in Log file - UNIX

I am writing a shell script with 2 run time arguments. During the execution if i got any error, then it needs to redirected to a error file and in console. Also both error and output to be redirected to a log file. But i am facing the below error. #! /bin/sh errExit () { errMsg=`cat... (1 Reply)
Discussion started by: sarathy_a35
1 Replies
PENLOGD(1)						      General Commands Manual							PENLOGD(1)

NAME
penlogd - consolidate web server logs SYNOPSIS
penlogd [-fd] [-j dir] [-l logfile] [-n N] [-p pidfile] [-u user] port EXAMPLE
penlogd -l /var/log/access_log -p /var/run/penlogd.pid 10000 DESCRIPTION
Penlogd receives log entries from Pen and from each of the web servers. It consolidates the entries by replacing the source addresses in each entry with the "real" client address and writes the result to stdout or to the file given on the command line. This completely removes the need for postprocessing with mergelogs, since the logs are already merged. Pen must be instructed to send its log to penlogd. See HOWTO and pen man page for details. Sending penlogd a HUP signal will make it close and reopen the logfile, unless it is logging to stdout. Rotate the log like this: mv access_log access_log.1 kill -HUP `cat <pidfile>` where <pidfile> is the file containing pen's process id. Sending penlogd a TERM signal will make it close the log file and exit cleanly. OPTIONS
-d Turn on debugging. The output goes to stderr if we are running in the foreground (see -f) and to syslog (facility user, priority debug) otherwise. -f Stay in foreground. -j dir Run in a chroot environment. -l logfile Write output into logfile. -n N Number of pen log entries to cache (default 1000). -p pidfile Write process id into pidfile. -u user Run as a different user. port The UDP port where penlogd receives log entries. SEE ALSO
pen(1), penlog(1), webresolve(1) AUTHOR
Copyright (C) 2002-2003 Ulric Eriksson, <ulric@siag.nu>. LOCAL PENLOGD(1)
All times are GMT -4. The time now is 07:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy