more scripting

marc brady mandrakeexpert at expressindustrial.com.au
Sat May 18 07:23:45 PDT 2002


It is working with tims setup but do you think the way i was writing it 
originally was better ?

would I just apply the same "\" to the sed lines in question so that they dont 
get striped?

did you see that massive thing

its on one of these post take a look at it

now i need to start makeing it system indepedent so it write the files that 
are needed on the machine so if they are not in the proper setup or location 
on the different system it will not matter

by the way that brings a problem

I tryed useing cat in the scripts to write the files but that is a disaster

inside of the subscripts cat does not work throws out tons of syntax errors 
and end of file errors but if it take the same cat script and place it in a 
script byitslef then call the scipt from the main script it will 
work????!!!!!

whats up with that

ignore the punctuation I am horrible typer

marc



On Friday 17 May 2002 10:17 pm, you wrote:
> I think you want to go back to you original and just do the
> quote things I showed. Yoyr first script was the "clean"
> one - you just were not allowing for the parsing bash does.
>
> In your original:
>   - put a single \ ahead of the original double-quotes.
>   - change the single quotes to double quotes.
>
> That should work. I test that little piece of code before I
> posted it and it gave me "Hello" in place of all aaa strings.
>
> On Sat, 18 May 2002, marc brady wrote:
> > here's where I am now
> >
> > created variable
> >
> > cd=append=" $yy=ide-scsi $zz=ide-scsi"
>
> You must be getting frustrated. Kick back, 3 deep
> breaths... Now, how are double quotes going to get
> in your string when you were just told that bash
> strips them? Hmmmm? You have to take steps, as I
> showed below to tell bash to *ignore* some of them.
>
> Read on down and *think* about what is said and you
> will see that your original was the right thing to
> do and changing the quoting is the right thing to do.
>
> Look at my example I sent. It works. Yours will also
> work if you attend to the rules of quoting as burned
> in man on the mount by the fire that descended from
> above and burned your bush!  ;)
>
> > then use
> >
> > -e "$cd"
> >
> > this ouputs
> >
> > append= hdc=ide-scsi hdd=ide-scsi
> >
> > so close but so far away
> >
> > marc
> >
> > On Friday 17 May 2002 09:50 pm, you wrote:
> > > See below.
> > >
> > > On Fri, 17 May 2002, timothy bauscher wrote:
> > > > > what is wrong with this line please
> > > > >
> > > > > sed -e '21a\' -e 'append=" $yy=ide-scsi $zz=ide-scsi"'
> > > > > /etc/lilo.conf1
> > > >
> > > > i don't think you can escape ' (\')
> > >
> > > Bash protects everythiiing with single quotes from substitution. If
> > > you want to substitute, in this case, use double quotes before append
> > > and at the end of the command.
> > >
> > > You then have the problem of how do you get douple quotes inside
> > > the double quotes. Recall that the sed will not see the outer pair
> > > of double quotes - bassh will strip them for you. But bash will
> > > also respond to the inner quotes. These need to be escaped with
> > > \. This works for me.
> > >
> > >    B=Hello
> > >    sed -e "s/aaa/\"$B\"/" << EOD
> > >       aaa
> > >          aaa
> > >    bbbaaa
> > >    bbbbbbaaa
> > >    EOD
> > >
> > > You see how to apply it?
> > >
> > > > --
> > > > tab
> > > > timothy(at)foce.eiomail.com  www.linuxfromscratch.org
> > >
> > > Bill Maltby
> > > billm at wlmcs.com
> >
> > --
> > Unsubscribe: send email to listar at linuxfromscratch.org
> > and put 'unsubscribe blfs-support' in the subject header of the message

-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe blfs-support' in the subject header of the message



More information about the blfs-support mailing list