簡體   English   中英

auto select 選項列表中的選項,無需輸入值

[英]auto select the option from the list of options without entering the value

命令是"source meta-cmf-raspberrypi/setup-environment" 運行此命令后,它為我提供了一個環境列表,之后用戶應該給出一個 integer 值。 一旦給出輸入,就會選擇所需的環境。 我想自動執行此命令,因為所選環境選項始終保持不變。

例如:假設當我運行此命令時,我得到如下列表:

subhro@Subhro-ThinkCentre-M79:~/Desktop/rdkb_workspace$ source meta-cmf-raspberrypi/setup-environment
 1) meta-cmf-bsp-emulator/conf/machine/qemux86broadbanddev.conf
 2) meta-cmf-bsp-emulator/conf/machine/qemux86hybdev.conf
 3) meta-cmf-raspberrypi/conf/machine/raspberrypi3-64-rdk-broadband.conf
 4) meta-cmf-raspberrypi/conf/machine/raspberrypi-rdk-broadband.conf
 5) meta-cmf-raspberrypi/conf/machine/raspberrypi-rdk-broadband-musl.conf
 6) meta-cmf-raspberrypi/conf/machine/raspberrypi-rdk-hybrid.conf
 7) meta-cmf-raspberrypi/conf/machine/raspberrypi-rdk-hybrid-westeros.conf
 8) meta-cmf-raspberrypi/conf/machine/raspberrypi-rdk-mc.conf
 9) meta-cmf-raspberrypi/conf/machine/raspberrypi-rdk-mc-westeros.conf
10) meta-raspberrypi/conf/machine/raspberrypi0.conf
11) meta-raspberrypi/conf/machine/raspberrypi2.conf
12) meta-raspberrypi/conf/machine/raspberrypi3-64.conf
13) meta-raspberrypi/conf/machine/raspberrypi3.conf
14) meta-raspberrypi/conf/machine/raspberrypi.conf
15) meta-rdk-bsp-emulator/conf/machine/qemuarmbroadband.conf
16) meta-rdk-bsp-emulator/conf/machine/qemux86broadband.conf
17) meta-rdk-bsp-emulator/conf/machine/qemux86hyb.conf
18) meta-rdk-bsp-emulator/conf/machine/qemux86hyb-morty.conf
19) meta-rdk-bsp-emulator/conf/machine/qemux86mc.conf
20) meta-rdk-bsp-emulator/conf/machine/qemux86mc-morty.conf
21) openembedded-core/meta/conf/machine/qemuarm64.conf
22) openembedded-core/meta/conf/machine/qemuarm.conf
23) openembedded-core/meta/conf/machine/qemux86-64.conf
24) openembedded-core/meta/conf/machine/qemux86.conf
25) openembedded-core/meta-selftest/conf/machine/qemux86copy.conf
Please enter your choice of machine [1..25]: 

我想運行一個命令,它會自動將 select 選項。 我已經嘗試使用"echo"並使用 source meta-cmf 命令對命令進行流水線操作,它有效。 但我正在尋找別的東西。

這也是一種方法,應該適用於此。 它選擇 9. 選項。

source meta-cmf-raspberrypi/setup-environment <<EOF
9
EOF

在調用安裝環境腳本之前,您只需將MACHINE環境變量設置為您要為其構建的機器:

例子:

MACHINE="raspberrypi4-64" source meta-cmf-raspberrypi/setup-environment

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM