07-12-2008
Script Help
I have file standardfilecleanup.lst which has contents as below :
db:background_dump_dest:alert.log:test.log:rest:log
db:user_dump_dest:best.log:test.log
db:core_dump_dest:test.log
Below is my script :
#set -xv
i=5
while [ $i -le 3 ]
do
var_value="$"`echo $i`
file_name=`cat standardfilecleanup.lst|awk -F: {'print ${var_value}`
echo ${file_name}
i=`expr $i + 1`
done
When I run my script it is erroring out on below line.
file_name=`cat standardfilecleanup.lst|awk -F: {'print ${var_value}`
My expectation is :
when $var_value is $3 file_name variables value should be alert.log.
when $var_value is $4 file_name variables value should be test.log.
when $var_value is $5 file_name variables value should be rest:log.
Any help is greatly appreciated.
5 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi guys
I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file.
#!/bin/sh
echo " $2 $3 $4 $5 $6 $7
isql -w400 -U$2 -S$5 -P$3 << xxx
use $4
go
print"**Changes to the table... (0 Replies)
Discussion started by: magikminox
0 Replies
2. Shell Programming and Scripting
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)
Discussion started by: ketanraut
1 Replies
3. UNIX for Dummies Questions & Answers
I am trying to call a script(callingscript.sh) from a master script(masterscript.sh) to get string type value from calling script to master script. I have used scripts mentioned below.
#masterscript.sh
./callingscript.sh
echo $fileExist
#callingscript.sh
echo "The script is called"... (2 Replies)
Discussion started by: Raj Roy
2 Replies
4. Shell Programming and Scripting
Hello all,
I am facing a weird issue while executing a code below -
#!/bin/bash
cd /wload/baot/home/baotasa0/sandboxes_finance/ext_ukba_bde/pset
sh UKBA_publish.sh UKBA 28082015 3
if
then
echo "Param file conversion for all the areas are completed, please check in your home directory"... (2 Replies)
Discussion started by: ektubbe
2 Replies
5. Shell Programming and Scripting
I'm new to utilities like socat and netcat and I'm not clear if they will do what I need.
I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes.
I'm using Cygwin bash on Windows 10.
My... (3 Replies)
Discussion started by: siegfried
3 Replies
LOG1P(3) 1 LOG1P(3)
log1p - Returns log(1 + number), computed in a way that is accurate even when the value of number is close to zero
SYNOPSIS
float log1p (float $number)
DESCRIPTION
log1p(3) returns log(1 + $number) computed in a way that is accurate even when the value of $number is close to zero. log(3) might only
return log(1) in this case due to lack of precision.
PARAMETERS
o $number
- The argument to process
RETURN VALUES
log(1 + $number)
CHANGELOG
+--------+--------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+--------------------------------------------------+
| 5.3.0 | |
| | |
| | This function is now available on all platforms |
| | |
+--------+--------------------------------------------------+
SEE ALSO
expm1(3), log(3), log10(3).
PHP Documentation Group LOG1P(3)