Wrong parameters are taking


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Wrong parameters are taking
# 8  
Old 12-28-2018
Quote:
Originally Posted by venkat918
...
Code:
if [[ "${num[0]}" != "" ]] || [[ "${num[1]}" != "" ]] || [[ "${num[2]}" != "" ]] || [[ "${num[3]}" != "" ]] || [[ "${num[4]}" != "" ]]
then
val1=`echo ${num[0]}`
inst_val1=$(($val1-1))

I would do differently. Would change this line
Code:
for skyline_instance_name in `(cd /var/lib/mysql;ls -d skyline? | grep -v skyline1)`

like this
Code:
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
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Why result is wrong here ? whether break statement is wrong ?

Hi ! all I am just trying to check range in my datafile pls tell me why its resulting wrong admin@IEEE:~/Desktop$ cat test.txt 0 28.4 5 28.4 10 28.4 15 28.5 20 28.5 25 28.6 30 28.6 35 28.7 40 28.7 45 28.7 50 28.8 55 28.8 60 28.8 65 28.1... (2 Replies)
Discussion started by: Akshay Hegde
2 Replies

2. UNIX Desktop Questions & Answers

scripts taking arguments

I am trying to write a script using commands to print a sequence of numbers. However, I can't get jot to recognize what I give it. Terri$ cat mncmd echo "m=$1" echo "n=$2" $jot $2 Terri$ ./mncmd 1 10 m=1 n=10 ./mncmd: line 3: $2: command not found I've also tried Terri$ cat... (3 Replies)
Discussion started by: justOne21
3 Replies

3. Shell Programming and Scripting

taking characters and counting them

Nevermind, I figured out a way using the sed command. But I forget the basic way of counting characters within a variable :( (4 Replies)
Discussion started by: puttster
4 Replies

4. AIX

tuning network parameters : parameters not persist after reboot

Hello, On Aix 5.2, we changed the parameters tcp_keepinit, tcp_keepintvl and tcp_keepidle with the no command. tunrestore -R is present in inittab in the directory /etc/tunables we can clearly see the inclusion of parameters during reboot, including the file lastboot.log ... (0 Replies)
Discussion started by: dantares
0 Replies

5. Shell Programming and Scripting

Taking a particular attribute's value in a file...

HI, Iam new to scripting..I need some guidance for invoking the following logic.. My input file contains Event Time = Thu, Nov 6, 2008 08:41:56 AM Probable Cause = UnspecifiedReason Specific Problems = BTS down due to Tx ... (16 Replies)
Discussion started by: Llb
16 Replies

6. Programming

Dynamic loader taking function from wrong lib

Hi, I have two dynamically loaded libraries (shared objects), both of which include functions of the same name - foo. When I call 'foo' from libA, it takes it from libB, although it is implemented in libA as well. Since we need the function to be called from libA, we tried linking it with the... (1 Reply)
Discussion started by: rimon
1 Replies

7. UNIX for Dummies Questions & Answers

Taking a name out of $PATH

so here is my path: /usr/bin:/bin:/usr/sbin:/sbin:/Users/a:/usr/local/bin:/usr/X11/bin how would I remove only the "a" or name string within it? any help appreciated (7 Replies)
Discussion started by: cleansing_flame
7 Replies

8. UNIX for Dummies Questions & Answers

Asking on taking in and out paramter

Hi , as i'm doing a .sh script that uses $datafile variable to spool my value into another .sh script. How do i spool out my maybe another value from my second script file back to my first .sh script??? What does this exit $? mean? Thanks a lot! (1 Reply)
Discussion started by: blueberry80
1 Replies
Login or Register to Ask a Question