On Fri, Mar 19, 2021 at 09:42:36AM +0800, Luan Shengde wrote:
+set_mac() +{
- job_id=$(cat ipxe_script|awk -F'/' '/job_initrd_tmpfs/{print $(NF-1)}')
awk can directly read the file, better not add a extral step with 'cat file': job_id=$(awk -F'/' '/job_initrd_tmpfs/{print $(NF-1)}' ipxe_script)
Ok. it was my fault.
Thanks, Chenglong
Thanks, Luan Shengde
- if [ $(command -v es-find) ]; then
nr_nic=$(es-find id=$job_id | awk '/nr_nic/{print $2}' | tr -d ,)
- else
echo "command not found: es-find. set nr_nic=1"
sleep 1
- fi