The define command consumes the rest of the input line, on purpose.
Try this: define IP1 192.168.1.1 show macro show macro From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of jiangxiaom...@outlook.com Sent: Wednesday, May 11, 2022 10:34 PM To: vpp-dev@lists.fd.io Subject: Re: [vpp-dev] Change how "unix exec" executes cli scripts Hi Damjan, Currently command: define <variable-name> <value> also has some problem. In cli file have the following content: cat /tmp/a.cli: ``` define IP1 192.168.200.11 show macro ping $IP1 ``` in vpp cli will fail with the output: ``` IP1 192.168.200.11 ping: expecting IP4/IP6 address `$IP1'. Usage: ping {<ip-addr> | ipv4 <ip4-addr> | ipv6 <ip6-addr>} [ipv4 <ip4-addr> | ipv6 <ip6-addr>] [source <interface>] [size <pktsize:60>] [interval <sec:1>] [repeat <cnt:5>] [table-id <id:0>] [burst <count:1>] [verbose] ``` The macro defined in cli file, not worked in the same cli file.
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#21401): https://lists.fd.io/g/vpp-dev/message/21401 Mute This Topic: https://lists.fd.io/mt/90974441/21656 Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-