use the nohup command without getting nohup out + sql tip

本文探讨了如何在命令行中结合使用标准输出和错误输出的文件描述符,实现将两者输出到同一目的地,如/dev/null,以及如何在MySQL中使用临时表和特定运算符进行数据操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  • 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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值