11-22-2017
script's a good option I always forget about!
Alternatively alternatively, don't use
tee and just read
/var/log/yum.log
This User Gave Thanks to Scott For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi!
I want to write a script that will create an archive (via tar) that will restrict the size of the tar file. The size can be constrained using the keyword 'k' and providing the size restriction. The problem is that the script needs to know (detect) when the tar command prompts the user (which... (2 Replies)
Discussion started by: mitch8
2 Replies
2. Shell Programming and Scripting
hi, new to to forum...
i've been trying to create a script in tcsh but i'm having a problem with one thing...
the script has to keep log of it's input and output so i'm using
tee -a log | script | tee -a log
this keeps the logs as asked, but it gives me an extra empty prompt (not in the... (0 Replies)
Discussion started by: moseschrist
0 Replies
3. Shell Programming and Scripting
ok,
i am aware of adding the directory where the files are located into the .profile file but the problem is, its not working for me.
can someone please spell out how to properly edit these configuration files so i can run a command anywhere on the system without having to be in the... (2 Replies)
Discussion started by: Terrible
2 Replies
4. Solaris
I create a succesful pkgask 'response' file:
pkgask -r xyz.pkg
I then attempt to use the 'response' file with pkgadd:
pkgadd -nr /home/user/response -d /home/user/xyz.pkg
the prompts for user input still appear. I have also tried an 'admin' file but that still prompts for user input as... (1 Reply)
Discussion started by: prkfriryce
1 Replies
5. Shell Programming and Scripting
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)
Discussion started by: prasad111
4 Replies
6. Shell Programming and Scripting
Hi guys.
I m creating scripts which input multiple value , inside sqlplus script when it prompt/accept
do anybody know how to provide multiple value inside sqlplus script when it prompt.
like,
enter value for first:
enter value for second:
enter value "save file as " :
I m try... (11 Replies)
Discussion started by: tapia
11 Replies
7. UNIX for Advanced & Expert Users
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)
Discussion started by: vibhor_agarwali
7 Replies
8. Shell Programming and Scripting
Hi, I'm writing a script,
in the script I need to use tcpdump to capture some packets
however it needs root priviledge
my computer is configured by school and I have no real root priviledge
so I can't use sudo on my computer,like
Code:
sudo tcpdump ......
I have to use a limited... (1 Reply)
Discussion started by: esolve
1 Replies
9. Shell Programming and Scripting
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)
Discussion started by: kumarjt
1 Replies
10. Shell Programming and Scripting
Hi All,
I am a novice to UNIX, i need to know is there a way to provide 2 inputs when the shell prompts and i need to assign those 2 values to 2 separate variables. I dont want to give those values as a arguments (while running the script).
Thanks in advance!! (1 Reply)
Discussion started by: prasanna2166
1 Replies
LEARN ABOUT OPENSOLARIS
tee
tee(1) User Commands tee(1)
NAME
tee - replicate the standard output
SYNOPSIS
/usr/bin/tee
/usr/bin/tee [-ai] [file]...
ksh93
tee [-ail] [file]...
DESCRIPTION
/usr/bin/tee
/usr/bin/tee copies standard input to standard output, making a copy in zero or more files. tee does not buffer its output. The options
determine if the specified files are overwritten or appended to.
ksh93
The tee built-in in ksh93 is associated with the /bin and /usr/bin paths. It is invoked when tee is executed without a pathname prefix and
the pathname search finds a /bin/tee or /usr/bin/tee executable.
tee copies standard input to standard output and to zero or more files. The options determine whether the specified files are overwritten
or appended to. The tee utility does not buffer output. If a write to a file fails, tee continues to write to other files although it exits
with a non-zero exit status.
The number of file operands that can be specified is limited by the underlying operating system.
OPTIONS
/usr/bin/tee
The following options are supported by /usr/bin/tee:
-a Appends the output to the files rather than overwriting them.
-i Ignores interrupts.
ksh93
The following options are supported by the tee built-in command in ksh93:
-a Appends the output to the files rather than overwriting them.
--append
-i Ignores SIGINT signal.
--ignore-interrupts
-l Sets the standard output to be line buffered.
--line-buffer
OPERANDS
The following operands are supported:
file A path name of an output file. Processing of at least 13 file operands are supported.
USAGE
See largefile(5) for the description of the behavior of tee when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of tee: LANG, LC_ALL, LC_CTYPE, LC_MES-
SAGES, and NLSPATH.
EXIT STATUS
/usr/bin/tee
The following exit values are returned by /usr/bin/tee:
0 The standard input was successfully copied to all output files.
>0 The number of files that could not be opened or whose status could not be obtained.
ksh93
The following exit values are returned by tee in ksh93:
0 Successful completion.
>0 An error occurred.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
/usr/bin/tee
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
|CSI |Enabled |
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
|Standard |See standards(5). |
+-----------------------------+-----------------------------+
ksh93
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
|Interface Stability |See below. |
+-----------------------------+-----------------------------+
The ksh93 built-in binding to /bin and /usr/bin is Volatile. The built-in interfaces are Uncommitted.
SEE ALSO
cat(1), ksh93(1), attributes(5), environ(5), largefile(5), standards(5)
SunOS 5.11 20 Nov 2007 tee(1)