Wrong parameters are taking

Hi All,

Could you please assist the below query :-

had created the below script to print the below content email, however the instance now is not displaying correctly and it is print the wrong instance name.

Please find the below code for errors.sh , in this script had written the code as print any error from last 30 days and it is redirecting to

reverting the changes 

Please be aware that ANY program understanding / debugging without knowledge of the data is heavily based on assumptions and thus never can be accurate. So - pls. post sample input data, structures, directories, dir structures, etc.

I'd say you're expecting in vain. There are five lines in your code printing something similar, but they all look like

echo "<BR>INSTANCE NAME is : T0${valn}<BR>"

, so neither of above can possibly show up in your output. And what about the instance T01 ... T04 from your first code snippet? How do the two relate to each other?

Please start over, rephrase (in full sentences!) your request, explain from a way deeper level, so people get a chance to understand and comment.

And, BTW, your five repeated code parts lend themselves to being done in a loop, greatly improving reliability and readability of the script.

Maybe because you have a variable $skyline_instance_name == [ skyline2, skyline3, skyline4, skyline5 ] but not skyline1
and does not exist file skyline1_ERR_LIST.log
Array num == [ 2, 3, 4, 5]; hence the variable $val1 starts with 2

Thanks for your response.

had applied the below logic to acheieve my output .

if [[ "${num[0]}" != "" ]] || [[ "${num[1]}" != "" ]] || [[ "${num[2]}" != "" ]] || [[ "${num[3]}" != "" ]] || [[ "${num[4]}" != "" ]]
then
val1=`echo ${num[0]}`
inst_val1=$(($val1-1))

bakunin

2 Likes

I'm sincere apologies for inconvienced to all, will ensure not to repeat this type thing henceforth.

Hi Venkat918,

I can only agree with bakunin, this is not acceptable - it deprives members of answers when they search and is well against the ethos of a forum where people are prepared to devote time and knowledge for the benefit of others. You should reinstate the original request for help - which as bakunin pointed out you did recieve.

Regards

Gull04

I would do differently. Would change this line

for skyline_instance_name in `(cd /var/lib/mysql;ls -d skyline? | grep -v skyline1)`

like this

for skyline_instance_name in $(cd /var/lib/mysql;ls -d skyline?)

Then I would uncomment the next line with the pattern "skyline1)" in the operator "case" but shift all lines of commands in it.

P.S And yet, in fact, restoring post is easy, not necessarily literally, the main thing is that the basic idea is clear.
I think everyone understands that this is just from inexperience