Re: Need help with kickstart

Colm Buckley <[email protected]> Mon, 25 Apr 2016 13:26:17 +0100
Newsgroups gmane.user-groups.linux.ilug.general
Message-ID <CAPbCDfgJFzdAPf5+5Ns5kHxoZVnw7TEcHq11RAXxB90i=+HFeQ@mail.gmail.com>
For this and many other reasons, I strongly advise against using tcsh. The
differences in quoting, globbing and expansion rules between the c-shells
and bourne-shells are just enough to be an absolute minefield.

This case is even subtler; you're getting caught out by the rules regarding
null expansion. Normally, * and ? in shell command lines are expanded
before being passed to the command being run - eg: if you do "ls abc*" and
the current directory contains files called abcd, abce, abcf, these are
expanded by the shell before being passed to the "ls" command. The question
then becomes "what happens if there are no matches" - some shells are set
up to expand to nothing (ie: pass no arguments to the command), others pass
the original string (ls would receive the argument "abc*"); most shells can
be configured one way or the other.

yum can expand wildcards itself within the context of installable packages,
so it's important that the shell *not* try to expand these before passing
to yum. Normally you can prevent glob expansion by putting the argument in
single quotes - ie: yum install 'sssd-client-*.i686'.

In general, though - be very very wary of using glob patterns in shell
scripts; the behavior can vary wildly depending on the context of the shell
executing them. Stick with a particular shell (eg: bash or dash), and make
sure the quoting and globbing rules are set up properly in your script. And
then check it all again.

Colm ("rm -rf $dir/$file" is also fun...)


On Mon, Apr 25, 2016 at 10:39 AM, Gerard Hooton <[email protected]> wrote:

> Update:
> This seems to be a csh/tcsh thing, if I use the " " it works fine.
> In bash I do not need the ""
> //Ger
>
> On 25/04/16 10:33, Gerard Hooton wrote:
>
>> Thanks Paul for your reply.
>> I think the problem maybe the *
>> What I have discovered is that if I put yum -y install qt5* in a shell
>> script it will return yum: No match.
>> However if I put yum -y install "qt5*" in a shell script then works.
>> //Ger
>>
>> On 25/04/16 10:10, paul wrote:
>>
>>> Does the package list get updated before that line runs?
>>>
>>>
>>>
>>> On 25/04/16 09:08, Gerard Hooton wrote:
>>>
>>>> Hi All,
>>>> I have a problem with my kickstart post script.
>>>> I am installing Centos 6.7 64bit, however some applications require some
>>>> 32bit libs
>>>> So I decided to add the 32 bit installs to the kickstart post script.
>>>> My problem is that some of the packages will not install from the
>>>> script.
>>>> The following gives a yum: No match.
>>>> yum -y install sssd-client-*.i686
>>>>
>>>> Now, if I run this from the command line it works perfect.
>>>>
>>>> Any ideas?
>>>>
>>>>
>>
> --
> Gerard Hooton.
> Senior Technical Officer
> School of Engineering.
> University College Cork.
> College Road.
> Cork.
> Ireland.
> Tel: +353 21 4902296
> Mobile: +353 852813491
>
> --
> Irish Linux Users Group
> --- You received this message because you are subscribed to the Google
> Groups "ILUG" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send an email to [email protected].
> Visit this group at https://groups.google.com/a/linux.ie/group/ilug/.
> To view this discussion on the web, visit
> https://groups.google.com/a/linux.ie/d/msgid/ilug/571DE5C5.3010600%40ucc.ie
> .
>



-- 
Colm Buckley / [email protected] / +353 87 2469146

-- 
Irish Linux Users Group
--- 
You received this message because you are subscribed to the Google Groups "ILUG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send an email to [email protected].
Visit this group at https://groups.google.com/a/linux.ie/group/ilug/.
To view this discussion on the web, visit https://groups.google.com/a/linux.ie/d/msgid/ilug/CAPbCDfgJFzdAPf5%2B5Ns5kHxoZVnw7TEcHq11RAXxB90i%3D%2BHFeQ%40mail.gmail.com.