I’m new to shell scripts and I’m not having much luck with it. How would I extend the following snippet to just get the number between the [ and ] ?
$ forever list | grep app.js
--> data: [0] LxSl node app.js 26017 49833 /Users/username/.forever/LxSl.log 0:0:0:0.57
Thanks for your help
Pipe it to
awk '{print $3}'}, that’ll give you[0]To remove the brackets, you can e.g. use
tr -d []Everything can also be done from within awk, using
gsub. Then there issed…