use the nohup command without getting nohup out + sql tip

  • command tip

we can combine file descriptors together: 2>&1 means "send standard error wherever standard output is going". That means that we get a single stream of output that includes both standard out and standard error intermixed with no way to separate them anymore, but it also means that we can include standard error in a pipe.

So the sequence >/dev/null 2>&1 means "send standard output to /dev/null" (which is a special device that just throws away whatever we write to it) "and then send standard error to wherever standard output is going" (which we just made sure was /dev/null). Basically, "throw away whatever this command writes to either file descriptor"

for more info, you'd better read 1 reference.

 

  • mysql tip

a. Temporary tables only works in your curent open session.

b. in join sql, we can use >= operator

select 
  id, 
  substring_index(
    substring_index(email_recipients, ',', n), 
    ',', 
    -1
  ) as email
from dashboards
join numbers
  on char_length(email_recipients) 
    - char_length(replace(email_recipients, ',', '')) 
    >= n - 1

references:

1. https://stackoverflow.com/questions/10408816/how-do-i-use-the-nohup-command-without-getting-nohup-out

2. https://www.periscopedata.com/blog/splitting-comma-separated-values-in-mysql

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章