Tag Archives: SID

Fetching variable from config file

By rafa_fed2

I am using . .profile in my script below
I want to fech it it from my configuration file .id_pass_file.txt(it has all user_name and passwords)
how can i do this

Code:

PROFILE_PATH=. .profile
AND IN MY SCRIPT
$PROFILE_PATH
IS THIS CORRECT


Code:

#!/bin/sh
ORACLE_HOME=/var/opt/oracle/product/10g; export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin:/bin:/usr/bin; export PATH
today=`date "+%m-%d-%Y %H:%M:%S"`; export today
CUR_DIR=$1; export CUR_DIR

## /path/to/profile .This is required for crontab to work as bip.sh uses environmental variables.
. .profile

LOG_FILE=$CUR_DIR/error.log; export LOG_FILE

# Direct script output to log
exec > $LOG_FILE 2>&1

echo
echo
echo "LOGGING STARTS $today"
echo
echo
###Fetching the script directory from configuration file
SCRIPT_DIR=`cat $CUR_DIR/.id_pass_file.txt | grep "^SCRIPT_DIR" | cut -d "=" -f2`; export SCRIPT_DIR

### Credentials for SQLPLUS

USER_ID=`cat $CUR_DIR/.id_pass_file.txt | grep "^USER_ID" | cut -d "=" -f2`; export USER_ID
PWD=`cat $CUR_DIR/.id_pass_file.txt | grep "^PWD" | cut -d "=" -f2`; export PWD
SID=`cat $CUR_DIR/.id_pass_file.txt | grep "^SID" | cut -d "=" -f2`; export SID

### Connecting ORACLE

echo "SQLPLUS CONNECTION"

sqlplus -s $USER_ID@$SID/$PWD<$CUR_DIR/sql_output.txt
set feedback off
set heading off
select distinct account_no from adj WHERE ADJ_TRANS_CODE=-2401 and request_status=1 and bill_ref_no=0
order by account_no;
EOF

if [ $? -eq 0 ]
then
echo " SQLPLUS Connection Successful "
else
echo " SQLPLUS Connection Failed "
fi

##echo " The account numbers to be used in BIP are "

if [ ! -s "$CUR_DIR/sql_output.txt" ]
then
echo "No account number for bad debt"
else
for i in `cat $CUR_DIR/sql_output.txt`
do
echo "bip $i is running"
sh $SCRIPT_DIR/bip.sh 01 0 $i > $CUR_DIR/bip_log_1.txt
sleep 180
done
fi

###Removing temporary log files generated

if [ -f "$CUR_DIR/bip_log_1.txt" ]
then
rm "$CUR_DIR/bip_log_1.txt"
echo "file bip__log_1.txt removed"
fi

if [ -f "$CUR_DIR/sql_output.txt" ]
then
rm "$CUR_DIR/sql_output.txt"
echo "sql_output.txt removed"
fi

rm $CUR_DIR/error.log


…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

Issue with cron and environmental variable

By rafa_fed2

My shell script it.sh.I am calling bip.sh from it.sh

Code:

#!/bin/sh
ORACLE_HOME=/var/opt/oracle/product/10g; export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin:/bin:/usr/bin; export PATH
today=`date "+%m-%d-%Y %H:%M:%S"`; export today
CUR_DIR=$1; export CUR_DIR

LOG_FILE=$CUR_DIR/error.log; export LOG_FILE

# Direct script output to log
exec > $LOG_FILE 2>&1

echo
echo
echo "LOGGING STARTS $today"
echo
echo
###Fetching the script directory from configuration file
SCRIPT_DIR=`cat $CUR_DIR/.id_pass_file.txt | grep "^SCRIPT_DIR" | cut -d "=" -f2`; export SCRIPT_DIR

### Credentials for SQLPLUS

USER_ID=`cat $CUR_DIR/.id_pass_file.txt | grep "^USER_ID" | cut -d "=" -f2`; export USER_ID
PWD=`cat $CUR_DIR/.id_pass_file.txt | grep "^PWD" | cut -d "=" -f2`; export PWD
SID=`cat $CUR_DIR/.id_pass_file.txt | grep "^SID" | cut -d "=" -f2`; export SID

### Connecting ORACLE

echo "SQLPLUS CONNECTION"

sqlplus -s $USER_ID@$SID/$PWD<$CUR_DIR/sql_output.txt
set feedback off
set heading off
select 1016 from adj where rownum <2;
EOF

if [ $? -eq 0 ]
then
echo " SQLPLUS Connection Successful "
else
echo " SQLPLUS Connection Failed "
fi

##echo " The account numbers to be used in BIP are "

if [ ! -s "$CUR_DIR/sql_output.txt" ]
then
echo "No account number for bad debt"
else
for i in `cat $CUR_DIR/sql_output.txt`
do
echo "bip $i is running"
cd $SCRIPT_DIR
sh bip.sh 01 0 $i > $CUR_DIR/bip_log_1.txt
sleep 100
done
fi

###Removing temporary log files generated

if [ -f $CUR_DIR/bip_log_1.txt ]
then
`rm $CUR_DIR/bip_log_1.txt`
echo "file bip__log_1.txt removed"
fi

if [ -f $CUR_DIR/sql_output.txt ]
then
`rm $CUR_DIR/sql_output.txt`
echo "sql_output.txt removed"
fi


Code:

59 04 * * * /arbor/integ_fx/rahul_raj/itsr_5652/it.sh /arbor/integ_fx/rahul_raj/itsr_5652


my error.log file

Code:

LOGGING STARTS 07-22-2013 05:22:00

SQLPLUS CONNECTION
SQLPLUS Connection Successful
bip 1016 is running
cat: cannot open /.arborpw
file bip__log_1.txt removed
sql_output.txt removed.
ERROR: $ARBORDBU environment variable is not set

This script requires that the $ARBORDBU environment variable be set.


MY BIP.SH

Code:

#!/bin/sh
ARBOR_DB_PASSWD=`cat $ARBORDIR/.arborpw`; export ARBOR_DB_PASSWD
DB_PASS=$ARBOR_DB_PASSWD; export DB_PASS;
ORACLE_SID=$ARBOR_CATALOG_DATABASE; export ORACLE_SID;
ARBORCTRLRPT03=$ARBORDATA/reports/ctrl; export ARBORCTRLRPT03;

Usage(){
echo "nn Usage is: `basename $0` n"
echo " where is a number between 01 and 99"
echo " is a number. Use 0=production, 3=proforma, 6=backout"
echo " is an arbor accout numbernn"
exit 0
}

# Check number of arguments
if [ "$#" -ne 3 ] ; then
Usage
fi

# Check to see if ARBORDBU is set
if [ -z "${ARBORDBU}" ] ; then
echo "ERROR: $ARBORDBU environment variable is not setn"
echo "This script requires that the $ARBORDBU environment variable be set.nn"<br ...read more

Source: FULL ARTICLE at The UNIX and Linux Forums

Scheduling issues

By rafa_fed2

I AM ON SOLARIS

I have a script it.sh which is running fine when i execute it from shell command.
But when i schedule it in crontab it is throwing error.

Why and how can i resolve it ?i am clueless

IT.SH

Code:

#!/bin/sh
ORACLE_HOME=/var/opt/oracle/product/10g; export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin:/bin:/usr/bin; export PATH
today=`date "+%m-%d-%Y %H:%M:%S"`; export today
CUR_DIR=$1; export CUR_DIR

LOG_FILE=$CUR_DIR/error.log; export LOG_FILE

# Direct script output to log
exec > $LOG_FILE 2>&1

echo
echo
echo "LOGGING STARTS $today"
echo
echo
###Fetching the script directory from configuration file
SCRIPT_DIR=`cat $CUR_DIR/.id_pass_file.txt | grep "^SCRIPT_DIR" | cut -d "=" -f2`; export SCRIPT_DIR

### Credentials for SQLPLUS

USER_ID=`cat $CUR_DIR/.id_pass_file.txt | grep "^USER_ID" | cut -d "=" -f2`; export USER_ID
PWD=`cat $CUR_DIR/.id_pass_file.txt | grep "^PWD" | cut -d "=" -f2`; export PWD
SID=`cat $CUR_DIR/.id_pass_file.txt | grep "^SID" | cut -d "=" -f2`; export SID

### Connecting ORACLE

echo "SQLPLUS CONNECTION"

sqlplus -s $USER_ID@$SID/$PWD<$CUR_DIR/sql_output.txt
set feedback off
set heading off
select distinct account_no from adj WHERE ADJ_TRANS_CODE=-2401 and request_status=1 and bill_ref_no=0
order by account_no;
EOF

if [ $? -eq 0 ]
then
echo " SQLPLUS Connection Successful "
else
echo " SQLPLUS Connection Failed "
fi

##echo " The account numbers to be used in BIP are "

if [ ! -s "$CUR_DIR/sql_output.txt" ]
then
echo "No account number for bad debt"
else
for i in `cat $CUR_DIR/sql_output.txt`
do
echo "bip $i is running"
sh $SCRIPT_DIR/bip.sh 01 0 $i > $CUR_DIR/bip_log_1.txt
sleep 180
done
fi


My error is in error.log

Code:


LOGGING STARTS

SQLPLUS CONNECTION
SQLPLUS Connection Successful
bip 114034 is running
cat: cannot open /.arborpw


my error is bip_log_1.txt

Code:

ERROR: $ARBORDBU environment variable is not set

This script requires that the $ARBORDBU environment variable be set.


My bip.sh is

Code:

#!/bin/sh
ARBOR_DB_PASSWD=`cat $ARBORDIR/.arborpw`; export ARBOR_DB_PASSWD
DB_PASS=$ARBOR_DB_PASSWD; export DB_PASS;
ORACLE_SID=$ARBOR_CATALOG_DATABASE; export ORACLE_SID;
ARBORCTRLRPT03=$ARBORDATA/reports/ctrl; export ARBORCTRLRPT03;

Usage(){
echo "nn Usage is: `basename $0` n"
echo " where is a number between 01 and 99"
echo " is a number. Use 0=production, 3=proforma, 6=backout"
echo " is an arbor accout numbernn"
exit 0
}

# Check number of arguments
if [ "$#" -ne 3 ] ; then
Usage
fi

# Check to see if ARBORDBU is set
if [ -z "${ARBORDBU}" ] ; then
echo "ERROR: $ARBORDBU environment variable is not setn"
echo "This script requires that the $ARBORDBU environment variable be set.nn"
...read more

Source: FULL ARTICLE at The UNIX and Linux Forums

Files not being removed

By rafa_fed2

Code:

#!/bin/sh
ORACLE_HOME=/var/opt/oracle/product/10g; export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin:/bin:/usr/bin; export PATH
today=`date "+%m-%d-%Y %H:%M:%S"`; export today
CUR_DIR=$1; export CUR_DIR

LOG_FILE=$CUR_DIR/error.log; export LOG_FILE

# Direct script output to log
exec > $LOG_FILE 2>&1

echo
echo
echo "LOGGING STARTS $today"
echo
echo
###Fetching the script directory from configuration file
SCRIPT_DIR=`cat $CUR_DIR/.id_pass_file.txt | grep "^SCRIPT_DIR" | cut -d "=" -f2`; export SCRIPT_DIR

### Credentials for SQLPLUS

USER_ID=`cat $CUR_DIR/.id_pass_file.txt | grep "^USER_ID" | cut -d "=" -f2`; export USER_ID
PWD=`cat $CUR_DIR/.id_pass_file.txt | grep "^PWD" | cut -d "=" -f2`; export PWD
SID=`cat $CUR_DIR/.id_pass_file.txt | grep "^SID" | cut -d "=" -f2`; export SID

### Connecting ORACLE

echo "SQLPLUS CONNECTION"

sqlplus -s $USER_ID@$SID/$PWD<$CUR_DIR/sql_output.txt
set feedback off
set heading off
select 1016 from adj where rownum <2;
EOF

if [ $? -eq 0 ]
then
echo " SQLPLUS Connection Successful "
else
echo " SQLPLUS Connection Failed "
fi

##echo " The account numbers to be used in BIP are "

if [ ! -s "$CUR_DIR/sql_output.txt" ]
then
echo "No account number for bad debt"
else
for i in `cat $CUR_DIR/sql_output.txt`
do
echo "bip $i is running"
cd $SCRIPT_DIR
sh bip.sh 01 0 $i > $CUR_DIR/bip_log_1.txt
sleep 100
done
fi

###Removing temporary log files generated

if [ -f "$CUR_DIR/bip_log_1.txt" ]
then
rm "$CUR_DIR/bip_log_1.txt"
echo "file bip__log_1.txt removed"
fi

if [ -f "$CUR_DIR/sql_output.txt" ]
then
rm "$CUR_DIR/sql_output.txt"
echo "sql_output.txt removed"
fi


My error

error.log

Code:

SQLPLUS CONNECTION
SQLPLUS Connection Successful
bip 1016 is running
file bip__log_1.txt removed
./it.sh: syntax error at line 76: `end of file' unexpected


how do i remove sql_output.txt

…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

Another issue with crontab

By rafa_fed2

My shell script it.sh

Code:

#!/bin/sh
ORACLE_HOME=/var/opt/oracle/product/10g; export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin:/bin:/usr/bin; export PATH
today=`date "+%m-%d-%Y %H:%M:%S"`; export today
CUR_DIR=$1; export CUR_DIR

LOG_FILE=$CUR_DIR/error.log; export LOG_FILE

# Direct script output to log
exec > $LOG_FILE 2>&1

echo
echo
echo "LOGGING STARTS $today"
echo
echo
###Fetching the script directory from configuration file
SCRIPT_DIR=`cat $CUR_DIR/.id_pass_file.txt | grep "^SCRIPT_DIR" | cut -d "=" -f2`; export SCRIPT_DIR

### Credentials for SQLPLUS

USER_ID=`cat $CUR_DIR/.id_pass_file.txt | grep "^USER_ID" | cut -d "=" -f2`; export USER_ID
PWD=`cat $CUR_DIR/.id_pass_file.txt | grep "^PWD" | cut -d "=" -f2`; export PWD
SID=`cat $CUR_DIR/.id_pass_file.txt | grep "^SID" | cut -d "=" -f2`; export SID

### Connecting ORACLE

echo "SQLPLUS CONNECTION"

sqlplus -s $USER_ID@$SID/$PWD<$CUR_DIR/sql_output.txt
set feedback off
set heading off
select 1016 from adj where rownum <2;
EOF

if [ $? -eq 0 ]
then
echo " SQLPLUS Connection Successful "
else
echo " SQLPLUS Connection Failed "
fi

##echo " The account numbers to be used in BIP are "

if [ ! -s "$CUR_DIR/sql_output.txt" ]
then
echo "No account number for bad debt"
else
for i in `cat $CUR_DIR/sql_output.txt`
do
echo "bip $i is running"
cd $SCRIPT_DIR
sh bip.sh 01 0 $i > $CUR_DIR/bip_log_1.txt
sleep 100
done
fi

###Removing temporary log files generated

if [ -f $CUR_DIR/bip_log_1.txt ]
then
`rm $CUR_DIR/bip_log_1.txt`
echo "file bip__log_1.txt removed"
fi

if [ -f $CUR_DIR/sql_output.txt ]
then
`rm $CUR_DIR/sql_output.txt`
echo "sql_output.txt removed"
fi


when i execute the script manually ,it is working fine but when i schedule this job in crontab i get an error in error.log

Why?
Please help me.

crontab entry

Code:

59 04 * * * /arbor/integ_fx/rahul_raj/itsr_5652/it.sh /arbor/integ_fx/rahul_raj/itsr_5652


Code:


LOGGING STARTS 07-22-2013 05:22:00

SQLPLUS CONNECTION
SQLPLUS Connection Successful
bip 1016 is running
cat: cannot open /.arborpw
file bip__log_1.txt removed
sql_output.txt removed


…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

Log file being not generated in crontab

By rafa_fed2

My shell script it.sh

Code:

#!/bin/sh
ORACLE_HOME=/var/opt/oracle/product/10g; export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin:/bin:/usr/bin; export PATH
today=`date "+%m-%d-%Y %H:%M:%S"`; export today
CUR_DIR=$1; export CUR_DIR

LOG_FILE=error.log; export LOG_FILE

# Direct script output to log
exec > $LOG_FILE 2>&1

echo
echo
echo "LOGGING STARTS $today"
echo
echo
###Fetching the script directory from configuration file
SCRIPT_DIR=`cat $CUR_DIR/.id_pass_file.txt | grep "^SCRIPT_DIR" | cut -d "=" -f2`; export SCRIPT_DIR

### Credentials for SQLPLUS

USER_ID=`cat $CUR_DIR/.id_pass_file.txt | grep "^USER_ID" | cut -d "=" -f2`; export USER_ID
PWD=`cat $CUR_DIR/.id_pass_file.txt | grep "^PWD" | cut -d "=" -f2`; export PWD
SID=`cat $CUR_DIR/.id_pass_file.txt | grep "^SID" | cut -d "=" -f2`; export SID

### Connecting ORACLE

echo "SQLPLUS CONNECTION"

sqlplus -s $USER_ID@$SID/$PWD<$CUR_DIR/sql_output.txt
set feedback off
set heading off
select 1016 from adj where rownum <2;
EOF

if [ $? -eq 0 ]
then
echo " SQLPLUS Connection Successful "
else
echo " SQLPLUS Connection Failed "
fi

##echo " The account numbers to be used in BIP are "

if [ ! -s "$CUR_DIR/sql_output.txt" ]
then
echo "No account number for bad debt"
else
for i in `cat $CUR_DIR/sql_output.txt`
do
echo "bip $i is running"
cd $SCRIPT_DIR
sh bip.sh 01 0 $i > $CUR_DIR/bip_log_1.txt
sleep 100
done
fi

###Removing temporary log files generated

if [ -f $CUR_DIR/bip_log_1.txt ]
then
`rm $CUR_DIR/bip_log_1.txt`
echo "file bip__log_1.txt removed"
fi

if [ -f $CUR_DIR/sql_output.txt ]
then
`rm $CUR_DIR/sql_output.txt`
echo "sql_output.txt removed"
fi


when i execute the script manually ,it is working fine but when i schedule this job in crontab error.log file is not generated

Why?
Please help me.

crontab entry

Code:

59 04 * * * /arbor/integ_fx/rahul_raj/itsr_5652/it.sh /arbor/integ_fx/rahul_raj/itsr_5652


…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

Removing log files

By rafa_fed2

Code:

#!/bin/sh
ORACLE_HOME=/var/opt/oracle/product/10g; export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin:/bin:/usr/bin; export PATH
today=`date "+%m-%d-%Y %H:%M:%S"`; export today
CUR_DIR=$1; export CUR_DIR

LOG_FILE=error.log; export LOG_FILE

# Direct script output to log
exec > $LOG_FILE 2>&1

echo
echo
echo "LOGGING STARTS $today"
echo
echo
###Fetching the script directory from configuration file
SCRIPT_DIR=`cat .id_pass_file.txt | grep "^SCRIPT_DIR" | cut -d "=" -f2`; export SCRIPT_DIR

### Credentials for SQLPLUS

USER_ID=`cat .id_pass_file.txt | grep "^USER_ID" | cut -d "=" -f2`; export USER_ID
PWD=`cat .id_pass_file.txt | grep "^PWD" | cut -d "=" -f2`; export PWD
SID=`cat .id_pass_file.txt | grep "^SID" | cut -d "=" -f2`; export SID

### Connecting ORACLE

echo "SQLPLUS CONNECTION"

sqlplus -s $USER_ID@$SID/$PWD<$CUR_DIR/sql_output.txt
set feedback off
set heading off
select 1016 from adj where rownum <2;
EOF

if [ $? -eq 0 ]
then
echo " SQLPLUS Connection Successful "
else
echo " SQLPLUS Connection Failed "
fi

##echo " The account numbers to be used in BIP are "

if [ ! -s "sql_output.txt" ]
then
echo "No account number for bad debt"
else
for i in `cat sql_output.txt`
do
echo "bip $i is running"
cd $SCRIPT_DIR
sh bip.sh 01 0 $i > $CUR_DIR/bip_log_1.txt
sleep 100
done
fi

###Removing temporary log files generated

if [ -f $CUR_DIR/bip_log_1.txt ]
then
`rm $CUR_DIR/bip_log_1.txt`
echo "file bip__log_1.txt removed"
fi

if [ -f $CUR_DIR/sql_output.txt ]
then
`rm $CUR_DIR/sql_output.txt`
echo "sql_output.txt removed"
fi

rm $CUR_DIR/error.log


I want to remove the 3 files that are being genarated.
How can i do this
I am getting an error

Code:

file bip__log_1.txt removed
./it.sh: syntax error at line 76: `end of file' unexpected


My code should work for all paths that i give

…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

Blatter pushes for 2022 World Cup in winter

FIFA president Sepp Blatter will push for the 2022 World Cup in Qatar to be moved to the winter after getting a personal taste of the Middle East’s blast furnace climate.

There has been widespread concern over the health dangers posed by staging the tournament in the Gulf in June and July where temperatures rocket to 50 degrees (122 degrees Fahrenheit).

Blatter insisted on Wednesday that he will push to have the World Cup moved despite the effects it could have on domestic leagues when the FIFA Executive Committee meets in October.

“The Executive Committee will certainly follow me,” Blatter was quoted by AFP subsidiary, SID, as telling a two-day sports conference in Austria.

Blatter said that a recent visit to Jordan and the Palestinian Territories had brought home the dangers of the intense heat.

He expressed his fears despite the Qataris’ ambitious plans to build air-conditioned arenas.

“It is clear that you cannot play in this heat in the summer and we have to consider the players,” he said.

“It is certainly possible to cool a stadium, but not an entire country. That’s why we need to have courage in the Executive Committee and to create awareness among the leagues that we need to change something.”

Qatar plans to spend around ??65 billion ($101 billion, 76 billion euros) on infrastructure projects, including building new high-tech stadiums, which the Qatar 2022 Supreme Committee said would likely cost $4-5 billion.

Average temperatures in Qatar are markedly cooler in December, with highs of 24C and lows of 15C.

In June this year, UEFA general secretary Gianni Infantino added his weight to calls for the 2022 World Cup to be staged later in the year.

“I fully share the view that you have to play in the best period for football; that is not June or July in Qatar. This is an issue that FIFA has to sort out,” he said.

“The sooner they do it, the better. The decision for 2022 was taken in 2010, so in 12 years you can organise yourself.”

Qatar has already said it was ready to host the World Cup in summer or in winter.

“Various figures from the world of football have raised preferences for hosting in the winter,” the Qatar 2022 Supreme Committee said in a statement earlier this year.

“We are ready to host the World Cup in summer or winter. Our planning isn’t affected either way.”

The committee said it planned to provide air-conditioning in stadiums, training area and public zones, and would do so with renewable energy.

“We will forge ahead with implementing and developing this technology. Our commitment to this is grounded in the legacy it will offer for Qatar and countries with similar climates.”

…read more

Source: FULL ARTICLE at Fox World News

Theory models, EMSL capabilities illuminate how particles grow in the atmosphere

Determining the chemical mechanisms that govern new particle formation, or NPF, in the atmosphere is not something that can be pulled out of thin air. In the atmosphere, nucleating clusters are presumed to be composed of a few common species: sulfuric acid (the key chemical component), ammonia, amines (ammonia derivatives), and water—all of which have different effects on nucleation and particle growth. Moreover, these same clusters may significantly impact cloud condensation nuclei, the particles that spawn cloud formation, and, in turn, affect global climate. Scientists used EMSL‘s Fourier transform ion cyclotron resonance mass spectrometer equipped with surface-induced dissociation (SID) to examine and model fragmentation kinetics and energetics of small clusters that may serve as precursors to NPF. …read more

Source: FULL ARTICLE at Phys.org

Can't create file in CGI Script

By larryjmoon

Hi I have some simple script within the context of a cgi script that create a file to write to. If I run the script from the command line as root the file is created with no issue. However when I run the script from a web page with the apache account, it dies. The code lines are:

Code:

sub Populate_Session_File {
open (NEWOUT,">/var/www/cgi-bin/sessions/$SID") || die "can't open the sessions file";
print NEWOUT "$SID11$empnum11$first_name11$last_name11$mailaddern";
close (NEWOUT) || die "can't close the spaceout file";
} # end populate session File


And the error I get is:

“[Tue Mar 12 06:07:58 2013] [error] [client IP] can’t open the sessions file at /var/www/cgi-bin/riskpect_dsp_login.pl line 238., referer: http://blah.blah
[Tue Mar 12 06:07:58 2013] [error] [client IP] Premature end of script headers: riskpect_dsp_login.pl, referer: http://blah.blah

Thanks in advance for any help

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

If else continue to check value until it it is right

By tapia

i have script which get Input via READ value and compare it from file.
when found do some stuff…if not found again ask for Input until you dont enter Right value.


#!/bin/ksh
echo "SID must be in oratab file"
echo "Enter ORACLE_SID of Database:c "
read ORACLE_SID
x=`cat /etc/oratab| grep $ORACLE_SID | wc -l`
for X in $x
do
if [[ $X -eq 1 ]];then
echo "SID FOUND"
else
echo "nothing found"
echo "Enter valid SID"
continue
fi
done


but script just check value ,it does not continue keep ask or value , if value is not correct.

Could you please help on it.

Thanks.

Source: FULL ARTICLE at The UNIX and Linux Forums