|
From: Ben R. <be...@us...> - 2002-03-01 19:32:15
|
Hello Dave,
>Hi,
>
>I spoke too soon -- I had a problem. :-)
>
>On Wed, Feb 27, 2002 at 01:51:38PM -0600, Steve Pratt wrote:
>> Command file would look something like: (comment lines not allowed in
>> actual commandfile)
>>
>> #remove volume
>> revert:/dev/evms/snap
>>
>> #remove feature object
>> revert:snap_obj
>>
>> #create new object
>> c:o,Snapshot
>>
={original=/dev/evms/rd/c0d01,snapshot=snap_obj,writeable=true,chunksize=128k},rd/c0d02
>>
>> #create new snapshot volume
>> c:v,snap_obj,name=/dev/evms/snap
>
>After changing the '128k' to '128kb', I was able to do this with 'evms
-m'.
>However, when I typed it into a file and tried 'evms -f file' I get:
>
>% cat file
>revert:/dev/evms/snap
>c:v,snap_obj,name=/dev/evms/snap
>% evms -f file
>
>
>Expecting command name.
>
>Current Token: V
>Token found at column 4, line 2.
>%
>
>But If I replace it with 'evms -m < file' it works. Help?
>
>...dave
The reason your command file does not work is because the command line
utility sees the command file as a single input stream, as if it was one
big command line typed at the EVMS: prompt. Multiple commands may be
entered on a command line by separating the commands with a colon. Since a
file is treated as one big command line, the commands in the file must be
separated by a colon. Thus, your command file would look like:
revert:/dev/evms/snap :
c:v,snap_obj,name=/dev/evms/snap
The command separator (the colon) can be placed anywhere after the end of
the first command but before the beginning of the second command. Also,
long commands may be spread across several lines without the need for
continuation characters. Here is an extract from a command file that is
part of our test suite: (NOTE: there are 406 partitions on sda before
this test case is run)
c:c,LvmRegMgr={name='High Hopes',pe_size=1MB},sda1,sda3,sda5,
sda7,sda9,sda11,sda13,sda15,sda17,sda19,sda21,sda23,
sda25,sda27,sda29,sda31,sda33,sda35,sda37,sda39,sda41,
sda43,sda45,sda47,sda49,sda51,sda53,sda55,sda57,sda59,
sda61,sda63,sda65,sda67,sda69,sda71,sda73,sda75,sda77,
sda79,sda81,sda83,sda85,sda87,sda89,sda91,sda93,sda95,
sda97,sda99,sda301,sda299,sda297,sda295,sda293,sda291,
sda289,sda287,sda285,sda283,sda281,sda279,sda277,sda275,
sda273,sda271,sda269,sda267,sda265,sda263,sda261,sda259,
sda257,sda255,sda253,sda251,sda249,sda247,sda245,sda243,
sda241,sda239,sda237,sda235,sda233,sda231,sda229,sda227,
sda225,sda223,sda221,sda219,sda217,sda215,sda213,sda211,
sda209 , sda207 , sda205 , sda203 , sda201
:e:'lvm/High Hopes',sda101,sda102,sda103,sda104,sda105,sda106,
sda107,sda108,sda109,sda110,sda111,sda112,sda113,sda114,
sda115,sda116,sda117,sda118,sda119,sda120,sda121,sda122,
sda123,sda124,sda125,sda126,sda127,sda128,sda129,sda130,
sda131,sda132,sda133,sda134,sda135,sda136,sda137,sda138,
sda139,sda140,sda141,sda142,sda143,sda144,sda145,sda146,
sda147,sda148,sda149,sda150,sda151,sda152,sda153,sda154,
sda155,sda156,sda157,sda158,sda159,sda160,sda161,sda162,
sda163,sda164,sda165,sda166,sda167,sda168,sda169,sda170,
sda171,sda172,sda173,sda174,sda175,sda176,sda177,sda178,
sda179,sda180,sda181,sda182,sda183,sda184,sda185,sda186,
sda187,sda188,sda189,sda190,sda191,sda192,sda193,sda194,
sda195 , sda196 , sda197 , sda198 , sda199 , sda200
:a:'lvm/High Hopes/Freespace', name = lv1,size=5MB
:a:'lvm/High Hopes/Freespace',name=lv2,size=5MB
:a:'lvm/High Hopes/Freespace',name= lv3,size=5MB
:a:'lvm/High Hopes/Freespace',name=lv4,size=5MB
:a:'lvm/High Hopes/Freespace',name=lv5,size= 5MB
:a:'lvm/High Hopes/Freespace',name=lv6,size =5MB
:a:'lvm/High Hopes/Freespace' ,name=lv7,size=5MB
: a : 'lvm/High Hopes/Freespace',name=lv8,size=5MB
:a:'lvm/High Hopes/Freespace',name=lv9,size=5MB
This example shows the command file separator being used as the character
immediately before a new command on all commands except the first. It also
shows how commands may be spread across multiple lines, and it uses the
abbreviations for command keywords. We will be adding support for 'C'
style comments in the next beta.
If you have any other questions or comments, or if you have any suggestions
for features or improvements, please let us know!
Thanks,
Ben Rafanello
EVMS Development - http://www.sf.net/projects/evms
IBM Linux Technology Center
(512) 838-4762
be...@us...
|