I have two regular expressions i.e. command1 and command2 where i need to combine both expressions into a single expression using |
for that command1 output should be passed to next expression.
command1:
grep 0x017a /sys/bus/pci/devices/*/device | cut -d/ -f6
>> Output : 00:00:01
command 2:
head -n1 /sys/bus/pci/devices/00:00:01/resource | cut -d ' ' -f 1 | tail -c 9
How to use command1 output (00:00:01) into command2 and combine into a single expression?
head -n1 /sys/bus/pci/devices/\
grep 0x017a /sys/bus/pci/devices/*/device | cut -d/ -f6`/resource | cut -d ' ' -f 1 | tail -c 9` work? – Hagen von Eitzen Feb 12 '19 at 01:01