当前位置: 首页 > news >正文

武汉的电商网站如何做营销推广

武汉的电商网站,如何做营销推广,许昌市做网站汉狮网络,阿里巴巴企业官网trap 命令用于指定在接收到信号后将要采取的动作,常见的用途是在脚本程序被中断时完成清理工作。当 shell 接收到 sigspec 指定的信号时, arg 参数(通常是执行命令)会被读取,并被执行。 1. 命令介绍 开始掌握基本的使用方式和方法 [1] 语法…

trap 命令用于指定在接收到信号后将要采取的动作,常见的用途是在脚本程序被中断时完成清理工作。当 shell 接收到 sigspec 指定的信号时, arg 参数(通常是执行命令)会被读取,并被执行。

在这里插入图片描述

1. 命令介绍

开始掌握基本的使用方式和方法

[1] 语法格式

trap [-lp] [[arg] sigspec …]
[2] 参数选项

编号 参数 含义
1 -p 列出当前设置的 trap 方法
2 -l 列出信号名称和相应的数字
[3] 常用的信号量

Number Name Notes
0 EXIT Always run on shell exit, regardless of exit code
1 SIGHUP -
2 SIGINT This is what ^C sends
3 SIGQUIT -
6 SIGABRT -
9 SIGKILL -
14 SIGALRM -
15 SIGTERM This is what kill sends by default

2. 实例说明

纸上得来终觉浅,绝知此事要躬行。

[1] 累计在退出时运行的trap工作列表

#on_exit and add_on_exit
#Usage:
#add_on_exit rm -f /tmp/foo
#add_on_exit echo “I am exiting”
#tempfile=KaTeX parse error: Expected 'EOF', got '#' at position 10: (mktemp) #̲add_on_exit rm …tempfile"

function on_exit() {
for i in “${on_exit_items[@]}”; do
eval $i
done
}

function add_on_exit() {
local n=KaTeX parse error: Expected '}', got '#' at position 2: {#̲on_exit_items[*…n]=“$*”
if [[ $n -eq 0 ]]; then
trap on_exit EXIT
fi
}

add_on_exit echo “I am exiting”
[2] 捕获SIGINT或Ctrl+C
#Run a command on signal 2 (SIGINT, which is what ^C sends)
function sigint() {
echo “Killed subshell!”
}

trap sigint INT

#This will be killed on the first ^C
echo “Sleeping…”
sleep 500
echo “Sleeping…”
sleep 500

#pressing ^C twice in a second to quit
last=0
function allow_quit() {
[ $(date +%s) -lt $(( KaTeX parse error: Expected 'EOF', got '&' at position 15: last + 1 )) ] &̲& exit echo…(date +%s)
}

trap allow_quit INT
[3] 清理临时文件
#Make a cleanup function
function cleanup() {
rm --force – “${tmp}”
}

#Trap special “EXIT” group, which is always run when the shell exits.
trap cleanup EXIT

#Create a temporary file
tmp=“(mktemp−p/tmptmpfileXXXXXXX)"echo"Hello,world!">>"(mktemp -p /tmp tmpfileXXXXXXX)" echo "Hello, world!" >> "(mktempp/tmptmpfileXXXXXXX)"echo"Hello,world!">>"{tmp}”
[4] 在退出时杀死子进程
#kill all spawned child processes of the shell on exit
trap ‘jobs -p | xargs kill’ EXIT
[5] 对终端窗口大小的变化做出反应
#signal WINCH(WINdowCHange) that is fired when one resizes a terminal window
declare -x rows cols

function update_size(){
rows=KaTeX parse error: Expected 'EOF', got '#' at position 14: (tput lines) #̲ get actual lin…(tput cols) # get actual columns of term
echo DEBUG terminal window has no $rows lines and is $cols characters wide
}

trap update_size WINCH

3. 删除进程树

一条命令也可以完成一个脚本的工作量

#How to get PID,PGID,sessionid etc ?
$ ps -o pid,ppid,pgid,gid,sess,cmd -U root
PID PPID PGID GID SESS CMD

#1.kill a group of processes with negative PID(Process ID)
$ kill -TERM -PID

#2. kill a group of processes with their PGID(Process Group ID)
$ kill – -$PGID Kill using the default signal (TERM = 15)
$ kill -9 -$PGID Kill using the KILL signal (9)

#3. kill a group processes with only PID info
$ kill – -$(ps -o pgid= $PID | grep -o [0-9]*)

#4.Using pkill, kill processes by PGID(Proess Group ID)
$ pkill -9 -g $PGID

#5.Using pkill, kill processes by GID(Group ID)
$ pkill -9 -G $GID

#6.Using pkill, kill processes by PPID(Parent Process ID)
$ pkill -9 -p $PPID

#7.Using pkill, kill processes by terminal
$ pkill -9 -t $terminal

#8.Using pkill, kill processes by process name
$ pkill -9 -x $process_name

#9.Using pkill, kill processes by session
$ pkill -9 -s $sess
新的一年
新的征程
新的课程开班
等你来学!

http://www.hkea.cn/news/923919/

相关文章:

  • 有没有兼职做设计的网站吗知名网络软文推广平台
  • 数据百度做网站好用吗米拓建站
  • 网站维护运营怎么做搜索引擎优化通常要注意的问题有
  • 圆梦科技专业网站建设恶意点击软件有哪些
  • 如何做vip电影解析网站竞价恶意点击器
  • 开发简单小程序公司深圳网站优化哪家好
  • 网站开发劣势搜索引擎排名优化
  • 桂林网站优化公司企业网络营销顾问
  • 上海外贸出口代理公司排名搜索引擎优化的主要工作有
  • 一般做企业网站需要什么资料广告咨询
  • 广州网站建设兼职网站为什么要做seo
  • 中企动力官网 网站怎么在平台上做推广
  • 教育培训网站建设方案广告宣传费用一般多少
  • 计算机网站设计论文营销排名seo
  • 源码资源国内专业seo公司
  • 丽水微信网站建设报价免费精准客源
  • 广东建设工程中标公示网站google搜索引擎优化
  • 南宁老牌网站建设公司正版google下载
  • 网站做信用认证有必要吗微信朋友圈推广平台
  • 电子政务网站建设要求百度关键词规划师
  • 博客网站开发毕设免费大数据分析网站
  • 深圳教育平台网站建设好消息疫情要结束了
  • 国外设计文章的网站淘宝代运营靠谱吗
  • 市桥网站建设sem论坛
  • 猎头公司是做什么的可靠吗排名优化外包公司
  • 扶贫网站建设关键词查询神器
  • 沈阳酒店企业网站制作公司2023年9月疫情又开始了吗
  • 厦门专业网站建设如何快速推广一个新产品
  • 帮人做传销网站违法吗seo网站排名助手
  • 如何做优品快报下的子网站营销型网站建设目标