FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 07-21-2008, 03:13 PM
Dan Thurman
 
Default Need help with getopts

I have: while getopts "achrv:d:e" opt

What I wanted was single flags as:

-a
-c
-h
-r
-v

in any order as well as

-d <directory>
-e <encodeType>

in any order as well.

But the above use of `:' is not doing what I want.

What am I doing wrong, please?

Thanks!
Dan

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 07-21-2008, 04:01 PM
"Carl D. Roth"
 
Default Need help with getopts

On Mon, 21 Jul 2008 08:13:32 -0700, Dan Thurman wrote:

> I have: while getopts "achrv:d:e" opt
>
> What I wanted was single flags as:
>
> -a
> -c
> -h
> -r
> -v
>
> in any order as well as
>
> -d <directory>
> -e <encodeType>
>
> in any order as well.
>
> But the above use of `:' is not doing what I want.
>
> What am I doing wrong, please?
>
> Thanks!
> Dan

Your syntax is wrong; change

"achrv:d:e"

to

"achrvd:e:"

C

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 07-21-2008, 06:46 PM
Dan Thurman
 
Default Need help with getopts

Carl D. Roth wrote:


On Mon, 21 Jul 2008 08:13:32 -0700, Dan Thurman wrote:

> I have: while getopts "achrv:d:e" opt
>
> What I wanted was single flags as:
>
> -a
> -c
> -h
> -r
> -v
>
> in any order as well as
>
> -d <directory>
> -e <encodeType>
>
> in any order as well.
>
> But the above use of `:' is not doing what I want.
>
> What am I doing wrong, please?
>
> Thanks!
> Dan

Your syntax is wrong; change

"achrv:d:e"

to

"achrvd:e:"


Thanks!
Dan

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 

Thread Tools




All times are GMT. The time now is 02:15 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org