LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What does this command DIR=$(sed -ne "s:^FIRMWARE_DIR=\([^, ]*\)........ mean? (https://www.linuxquestions.org/questions/linux-newbie-8/what-does-this-command-dir%3D%24-sed-ne-s-%5Efirmware_dir%3D%5C-%5B%5E-%5D%2A%5C-mean-583390/)

aiia 09-09-2007 10:51 AM

What does this command DIR=$(sed -ne "s:^FIRMWARE_DIR=\([^, ]*\)........ mean?
 
DIR=$(sed -ne "s:^FIRMWARE_DIR=\([^, ]*\).*:\1:p" \
/etc/hotplug/firmware.agent)
I try to install my wireless 1394 adapter, and in the Install guide, I can't understand this command, can anyone help me? Thank you!

druuna 09-09-2007 11:45 AM

Hi,

The variable DIR is filled with the output of the sed command.

The sed command looks into this /etc/hotplug/firmware.agent file for a line that matches this regular expression ^FIRMWARE_DIR=\([^, ]*\).* (FIRMWARE_DIR=...... on the beginning of a line). It cuts out what is found with this [^, ]* part and prints it.

DIR will be filled with the part that is printed.

Hope this helps.


All times are GMT -5. The time now is 06:40 PM.