[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: negative numbers in command line mode
From: |
Bryn M. Reeves |
Subject: |
Re: negative numbers in command line mode |
Date: |
Thu, 09 Aug 2012 17:16:17 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 |
On 08/09/2012 04:40 PM, address@hidden wrote:
> Hi
>
> I cannot get negative numbers to work in command line mode:
>
> # ./parted -v
> parted (GNU parted) 3.1
> [...]
> # ./parted /dev/cciss/c0d2 mkpart primary 1GiB -1s
> /root/parted-3.1/parted/.libs/parted: invalid option -- '1'
Put a '--' between the last real option and the '-1s' - this tells teh
getopt that parted uses that any remaining '-' prefixed strings are not
really options and should not be treated as such (same as doing "grep --
'-1'" for e.g.):
$ sudo parted /dev/loop1 mkpart primary 1GiB -1s
parted: invalid option -- '1'
$ sudo parted /dev/loop1 mkpart primary 1GiB -- -1s
$ echo $?
0
Regards,
Bryn.