Using tee command with ablity to provide input for prompts
OS version: RHEL 7.4
Shell : bash
I would like to capture command outputs using tee like # yum upgrade | tee yumupgradeLog
But, if I use tee command, I cannot respond to prompts like Is this ok [y/d/N]: during command execution as shown below.
Is there a way I could use tee and still be able to provide input for prompts ?
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)
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)
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)
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)
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 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)
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, 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)
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)
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 MOJAVE
package::constants5.18
Package::Constants(3pm) Perl Programmers Reference Guide Package::Constants(3pm)NAME
Package::Constants - List all constants declared in a package
SYNOPSIS
use Package::Constants;
### list the names of all constants in a given package;
@const = Package::Constants->list( __PACKAGE__ );
@const = Package::Constants->list( 'main' );
### enable debugging output
$Package::Constants::DEBUG = 1;
DESCRIPTION
"Package::Constants" lists all the constants defined in a certain package. This can be useful for, among others, setting up an
autogenerated "@EXPORT/@EXPORT_OK" for a Constants.pm file.
CLASS METHODS
@const = Package::Constants->list( PACKAGE_NAME );
Lists the names of all the constants defined in the provided package.
GLOBAL VARIABLES
$Package::Constants::DEBUG
When set to true, prints out debug information to STDERR about the package it is inspecting. Helps to identify issues when the results are
not as you expect.
Defaults to false.
BUG REPORTS
Please report bugs or other issues to <bug-package-constants@rt.cpan.org<gt>.
AUTHOR
This module by Jos Boumans <kane@cpan.org>.
COPYRIGHT
This library is free software; you may redistribute and/or modify it under the same terms as Perl itself.
perl v5.18.2 2014-01-06 Package::Constants(3pm)