- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsHi All,
I am running one ksh script to increment counter by 1. after meeting some condition. my code is:
TODAY=`date '+%d%m%Y'`
echo "Connecting to sybase Database for current file counter for IBD Outbound Files"
${SYB_BIN}/isql -U${DB_USER} -P ${DB_PASS} -S ${DB_SRV} -o IBD_FILE_RUN.out << EOF
set nocount on
go
select file_run from dcmpl_gcc..gls_ibd_file_co
go
EOF
file_run=`sed '1,2d' IBD_FILE_RUN.out | awk '{print $1}'`
echo "Latest File Run from Database is :$file_run"
if [ "$file_run" != 12 ]; then
echo " Hi iam in the if loop"
new_file_run=`expr $file_run + 1`
else
new_file_run=1
fi
echo "New file run is : $new_file_run"
while running script iam getting following error
Connecting to sybase Database for current file counter for IBD Outbound Files
Latest File Run from Database is :1
1
1
Hi iam in the if loop
expr: syntax error
New file run is :
Can Somebody Help?
it seems very small mistake somewhere.
new_file_run should be 2.
This question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership