When posting non-standard scripts, you should indicate which shell they are for.
Even better is to use standard syntax:
Quote:
The first one without "tee" works fine. echo "$INPUT" displays the values I type in for input. The second one always shows $INPUT as empty string. Why?[/code]
Where have you output the value of $INPUT? Not in $COMMAND, which is what you are redirecting.
Quote:
[code] Is there any other way to execute a shell function and capture its log output and at the same time display its output on the stdout device too without impacting its actual behavior? As you can see here, although the fucntion exports the variable INPUT, it is not available when the function call returns to the calling script code.
export does nothing there; export makes variables visible to child processes, not parent processes.
You are executing $COMMAND in a pipeline, and all elements of a pipeline (all but the last in ksh) are executed in a subshell.
Some background on what I am trying to accomplish - Accreditation/Certification for DoD (Unix/Linux) system: I am trying to improve the process for capturing key system information in preparation for performing a formal security review of a Unix or Linux system. This is in addition to the SRR... (1 Reply)
hi friends,
The code:
i=1
while
do
filename=`/usr/bin/ls -l| awk '{ print $9}'`
echo $filename>>summary.csv
#Gives the name of the file stored at column 9
count=`wc -l $filename | awk '{print $1}'`
echo $count>>summary.csv
#Gives just the count of lines of file "filename"
i=`expr... (1 Reply)
script1:
#!/bin/ksh
more test.txt
script2: calling the script1
#!/bin/ksh
/tmp/script1.sh 2>&1 | tee tee.log
where test.txt contains ~1200 lines.
When I execute the script2 the more command does not print pagewise it goes to the end of the line, when I remove the tee command it... (4 Replies)
Hi,
Want to log the output of command & check the exit status to find whether it succeeded or failed.
> ls abc
ls: abc: No such file or directory
> echo $?
1
> ls abc 2>&1 | tee log
ls: abc: No such file or directory
> echo $?
0
Tee commands changes my exit status to be always... (7 Replies)
hi guys, is there any way to capture the ip address of users who log-in to linux then capture the command executed together with the time and date?
example output
192.1.1.1 : ls -ltr Aug 6 16:38:40thanks in advance. (2 Replies)
Hi,
I'm sure this is real simple but in the looking I've done I haven't seen it addressed (or didn't realize it). I've started up a PuTTY connection to our UNIX box and started screen and script - no problems. Then I typed "tee teeKH18.txt" expecting it to start tee and dump all activity into... (2 Replies)
In the current directory , I have seven files .
But when I use the following command , it lists eight files ( 7 files + file_list.xtx)
ls -1 | tee file_list.xtx | while read line; do echo $line ; done
Does the tee command create the file_list.xtx file first and then executes the ls -1... (1 Reply)
I have the following script as shown below where I cat a file and then also tee the output to a file as I have to email the execution of the process to users at the end of the script:
cat incoming.dat | tee -a execution.log
if
then
echo "Issue with incoming.dat file, file not... (5 Replies)
Hello Experts,
Greeting to all of you.
I have a requirement, that we have a shell script status.sh
that check the status of server and server status shows as status.sh
Enterprise Server - Running
Admin Server - Shutdown
Requirement is like whenever the output shows shutdown it should... (2 Replies)
Discussion started by: aks_1902
2 Replies
LEARN ABOUT REDHAT
msgexec
MSGEXEC(1) GNU MSGEXEC(1)NAME
msgexec - process translations of message catalog
SYNOPSIS
msgexec [OPTION] COMMAND [COMMAND-OPTION]
DESCRIPTION
Applies a command to all translations of a translation catalog. The COMMAND can be any program that reads a translation from standard
input. It is invoked once for each translation. Its output becomes msgexec's output. msgexec's return code is the maximum return code
across all invocations.
A special builtin command called '0' outputs the translation, followed by a null byte. The output of "msgexec 0" is suitable as input for
"xargs -0".
Mandatory arguments to long options are mandatory for short options too.
Input file location:
-i, --input=INPUTFILE
input PO file
-D, --directory=DIRECTORY
add DIRECTORY to list for input files search
If no input file is given or if it is -, standard input is read.
Informative output:
-h, --help
display this help and exit
-V, --version
output version information and exit
AUTHOR
Written by Bruno Haible.
REPORTING BUGS
Report bugs to <bug-gnu-gettext@gnu.org>.
COPYRIGHT
Copyright (C) 2001-2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU-
LAR PURPOSE.
SEE ALSO
The full documentation for msgexec is maintained as a Texinfo manual. If the info and msgexec programs are properly installed at your
site, the command
info msgexec
should give you access to the complete manual.
GNU gettext 0.11.4 July 2002 MSGEXEC(1)