0

I want to substitute an output of a command with another command. In this case, I would like to take uuid and baseboard-serial-number of the machine using **dmidecode, **but those do not work on WSL and gave empty output.

I used different commands in WSL to get uuid and baseboard-serial-number :

for UUID :

wmic.exe csproduct get uuid | sed 's/\r$//' | sed -n 2p | sed 's/(.*)/\L\1/'

and

for baseboard-serial-number :

whoami.exe /user | sed 's/\r$//' | tail -n 1 | awk '{print $2}' && echo $WSL_DISTRO_NAME; } | md5sum - | awk '{ print $1}'

I want to substitute the output of both commands above with these commands : dmidecode -s system-uuid and dmidecode -s baseboard-serial-number.

Sayyid
  • 1
  • I don't understand your question, sorry. What is your current output and what is your expected output? What exactly do you want to replace? Do you want to replace commands or do you want to transform the output of an existing command? – knittl May 08 '23 at 07:04
  • @knittl , if I run dmidecode -s system-uuid on WSL it will return no response. If I run it on Linux without virtualization it will give us one line of text that represents the identity of the machine id like 2976e7de-b933-b447-94ee-fdb0ff89dfasdf. I can call the identity using a different command on WSL instead of dmidecode command. I'm looking the way how to use the dmidecode command on WSL but it will return the same output as the one works command. – Sayyid May 08 '23 at 07:28

0 Answers0