The first line "Redirected to STDOUT" which you expect to show up in the file mystdout got overwritten by the last one "Should default to STDOUT without redirection"...and this will happen with any sh not just the tcsh...and by appending to mystdout you will see both the lines there...
Tried it and I get the same result. I've tried "append redirect" (i.e. ">>") on the command line as suggested, and it did not work. I changed it in the script as well:
And "Redirect to STDOUT" still gets lost. I've tried all four combinations (i.e. ">" vs ">>" in script and on command line), and in all cases "Redirect to STDOUT" gets lost.
Is there some bizarre handling of the IO streams and redirects in tcsh that can explain this behavior?
Hi,
I've modified the syslogd source to include a thread that will keep track of a timer(or a timer thread). My intention is to check the file size of /var/log/messages in every one minute & if the size is more than 128KB, do a echo " " > /var/log/messages, so that the file size will be set... (7 Replies)
So in my shell i execute:
{ while true; do echo string; sleep 1; done } | read line This waits one second and returns.
But
{ while true; do /bin/echo string; sleep 1; done } | read line continues to run, and doesn't stop until i kill it explicitly.
I have tried this in bash as well as zsh,... (2 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hello everyone
Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried
sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
Hi Folks,
As per the subject, the following command is not working as expected.
echo $variable | mail -s "subject" "xxx@xxx.com"
Could anyone figure it out whats wrong with this. I am using AIX box.
Regards, (2 Replies)
logs:
"/home/abc/public_html/index.php"
"/home/abc/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
how to use "cut" or "awk" or "sed" to get the following result:
abc
abc
xyz
xyz
xyz (8 Replies)
Hello.
Following recommendations for one of my threads, this is working perfectly :
#!/bin/bash
CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" )
Now I need a grep success for some thing like :
#!/bin/bash
CNT=$( grep -c -e "some text_1... (4 Replies)
I use below code to get ip, and I want to echo something in the function, but the $IP will be all the value from "echo" I just want to get the real ip, and keep the echo info, any help
#!/bin/bash
get_ip()
{
ip=$(grep -B2 "00:01:02:03:04:05" ip_tmp.log |head -1 |awk '{print $2}')
... (4 Replies)
Dear Ladies & Gents,
I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out:
for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies
LEARN ABOUT MOJAVE
io::pager::page
IO::Pager::Page(3) User Contributed Perl Documentation IO::Pager::Page(3)NAME
IO::Pager::Page - Emulate IO::Page, pipe STDOUT to a pager if STDOUT is a TTY
SYNOPSIS
Pipes STDOUT to a pager if STDOUT is a TTY
DESCRIPTION
IO::Pager was designed to programmatically decide whether or not to point the STDOUT file handle into a pipe to program specified in the
PAGER environment variable or one of a standard list of pagers.
USAGE
BEGIN {
use IO::Pager::Page;
# use I::P::P first, just in case another module sends output to STDOUT
}
print<<HEREDOC;
...
A bunch of text later
HEREDOC
If you wish to forgo the potential for a Broken Pipe foible resulting from the user exiting the pager prematurely, load IO::Pager::Page
like so:
use IO::Pager::Page hush=>1;
SEE ALSO
IO::Page, IO::Pager, IO::Pager::Unbuffered, IO::Pager::Buffered
AUTHOR
Jerrad Pierce <jpierce@cpan.org>
Florent Angly <florent.angly@gmail.com>
This module inspired by Monte Mitzelfelt's IO::Page 0.02
COPYRIGHT AND LICENSE
Copyright (C) 2003-2012 Jerrad Pierce
o Thou shalt not claim ownership of unmodified materials.
o Thou shalt not claim whole ownership of modified materials.
o Thou shalt grant the indemnity of the provider of materials.
o Thou shalt use and dispense freely without other restrictions.
Or, if you prefer:
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.0 or, at
your option, any later version of Perl 5 you may have available.
perl v5.18.2 2012-09-04 IO::Pager::Page(3)