1753876 Members
7577 Online
108809 Solutions
New Discussion юеВ

Shell script problem

 
SOLVED
Go to solution
Alex Lavrov
Regular Advisor

Shell script problem

Hello,

I have a little problem in my script.
I'm trying to run omnidb command with next parameters:
-filesystem serv1:/opt/alex 'serv1:/opt/alex'

for some reason, when
x="serv1:/opt/alex"
y="'serv1:/opt/alex'"

or

x="serv1:/opt/alex 'serv1:/opt/alex'"

it does not run properly.
in debug mode (sh -x), I see the command that it's tryng to run and it looks correct, even if I copy&paste it to the command line it works, but from the script itself it does not.
The proble I think is in '. But every thing I tried to do with " or sed or whatever does not fix the problem ...

any ideas?

thanx.
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: Shell script problem

omniback has logs, there might be an error.

What shell are you using?

omniback can be scripted, but lots of people think the GUI does just fine (Bill Hassell: read sysadmins don't use GUI's).

Maybe post the sh -x output?

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
G. Vrijhoeven
Honored Contributor
Solution

Re: Shell script problem

Hi.

I did not test it but i think this will elininate the ' in yu vars.

y=`echo $y | sed s'/\'//'`
x=`echo $x | sed s'/\'//'`

Gideon
john korterman
Honored Contributor

Re: Shell script problem

Hi,
please show us the lines used in the script.

regards,
John K.
it would be nice if you always got a second chance
Leif Halvarsson_2
Honored Contributor

Re: Shell script problem

Hi,
I have had some problems with those ' in the label too. Here is one solution I have used:

store the label in a variable without any '

in the command line, fubstitute the label with

$(echo "'"$label"'")

Michael Schulte zur Sur
Honored Contributor

Re: Shell script problem

Hi,

why do you use no quotes for the first parameter and quotes for the second one. Could you post the command, you try to run and any error messages?

greetings,

Michael
Alex Lavrov
Regular Advisor

Re: Shell script problem

Well, looks like it works without quotes too .... strange, I thought I tried it. but probably not.

thanx all for your replies,
Merry Christmas or Hanukah! :)