I am trying to write a shell script that should load a kernel module at first.
modprobe wlcore_spi
The next step should wait this process to be finished(an output on std "wlcore loaded") then move forward. But how can this waiting action be done? I tried:
modprobe wlcore_spi
wait
echo "hello world"
It seems it's not worked as I expected. I searched abt it and it seems the best should be find the pid then simply wait for it. Then I start this job then typed "ps aux", it seems it's not in the process? It seems it starts somehow another process and eventually gives back a signal when it's finished. How can I catch this?
You can use && option for your case.
modprobe wlcore_spi && echo "hello world"
So command B will be executed when commanded A exited successfully.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.