Hi,
How to achieve this? Let us assume the following:
There are 2 scripts a.ksh and b.ksh
$ cat a.ksh
sh b.sh 2>&1 >> /work/log/a_log.txt
$ cat b.sh
echo "abcd"
My requirement is, is there a way to display this abcd in standard output also alongside of writing into a_log.txt?... (8 Replies)
New to Unix scripting and have written two scripts, one calling the other. When it returns to the calling script is it possible to return information, like a return code? :confused: (1 Reply)
Hi all,
I have a script that bulk loads thousands of lines of data. I need to log the output during the execution of the script.
I know I can redirect (">") the output to a file; however, I want the output going to both the screen and the log file.
I thought I could use pipe to pipe the... (10 Replies)
Hi all,
I have two ksh scripts
#sample1.sh
#!/bin/ksh
. ./sample2.sh
echo $fileExist
#sample2.sh
#!/bin/ksh
func()
{
i=1
return $a
}
func
echo $?
Here how should I return the value of sample2.sh back to sample1.sh?
Thanks in advance. (2 Replies)
Hello, I wanted to delete all files which are placed 14 days back. Here is my below script. My script works very well and it deletes all files 14 days back.
I wanted to display message incase if the delete script is not successful. The below script returns always successful. But the directory... (6 Replies)
Guys,
I need you help please.
The script below is not working correclty for checking via a awk/if statement . Can you tell me what i am doing wrong in the script code "if($1 == "$RETENTION_LEVEL") "
Syntax
RETENTION_LEVEL=`echo $LINE | cut -f2 -d" "`
echo " ==============... (4 Replies)
Hi All,
I need to return value to the main shell script, depending on whether the UPDATE command in the embedded pl/sql is successfu or not.
#!bin/ksh
updateStatus=`sqlplus --conn details-- << EOF
DECLARE
var_rows NUMBER;
BEGIN
update table_name
set column_name =... (7 Replies)
I am using blow script :--
#!/bin/bash
FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not
if
then
# echo "process found"
exit 0;
else
echo "process not found"
exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
I have a script that looks like this:
dirname2=/usr/tmp/filelist/*/*
for dirname2 in /tmp/filelist/*/*; do (cd $dirname2/catalog ||echo "file does not exist" && echo "$dirname2" |cut -d '/' -f 7,8 && echo $i && ls -la |awk 'NR>3 {SUM += $5} END { print "Total number of kb " SUM }');done... (2 Replies)
I want to make a config file which contain all the paths.
i want to read the config file line by line and pass as an argument on my below function.
Replace all the path with reading config path line by line and pass in respective functions.
how can i achieve that?
Kindly guide.
... (6 Replies)
Discussion started by: sadique.manzar
6 Replies
LEARN ABOUT PLAN9
confmodule
CONFMODULE(3) Library Functions Manual CONFMODULE(3)NAME
confmodule - communicate with Debian configuration system FrontEnd.
SYNOPSIS
#!/bin/sh -e
. /usr/share/debconf/confmodule
db_version 2.0
db_capb 'backup'
CAPB=$RET
db_input 'foo/bar' || true
db_go || true
DESCRIPTION
This is a library of shell functions that eases communication with Debian's configuration management system. It can communicate with a
FrontEnd via the debconf protocol. The design is that each command in the protocol is represented by one function in this module. The func-
tionname is the same as the command, except it is prefixed with "db_" and is lower-case. Call the function and pass in any parameters you
want to follow the command. Any textual return code from the FrontEnd will be returned to you in the $RET variable, while the numeric
return code from the FrontEnd will be returned as a return code (and so those return codes must be captured or ignored).
NOTES
Once this library is loaded, any text you later output will go to standard error, rather than standard output. This is a good thing in gen-
eral, because text sent to standard output is interpreted by the FrontEnd as commands. If you do want to send a command directly to the
FrontEnd, you must output it to file descriptor 3, like this:
echo GET foo/bar >&3
The library checks to make sure it is actually speaking to a FrontEnd by examining the DEBIAN_HAS_FRONTEND variable. If it is set, a Fron-
tEnd is assumed to be running. If not, the library turns into one, and runs a copy of the script that loaded the library connected to it.
This means that if you source this library, you should do so very near to the top of your script, because everything before the sourcing of
the library may well be run again.
SEE ALSO debconf-devel(7), dpkg-preconfigure(8), dpkg-reconfigure(8), debconf_specification in the debian-policy package
AUTHOR
Joey Hess <joeyh@debian.org>
CONFMODULE(3)