bash

How to use bash regex inside Makefile Target

对着背影说爱祢 提交于 2021-02-09 17:42:55
问题 In a bash script, the following regex appears to work well: MY_STRING="FirstName-LastName-Gender-Age" MY_REGEX="([^-]+)-([^-]+)$" if [[ $MY_STRING =~ $MY_REGEX ]]; then echo "Match: $BASH_REMATCH" fi I'm interested in using this script inside the Makefile. It appears to have syntax issues. For example: my-target: MY_STRING="FirstName-LastName-Gender-Age" MY_REGEX="([^-]+)-([^-]+)$" if [[ $MY_STRING =~ $MY_REGEX ]]; then echo "Match: $BASH_REMATCH" fi What would be the correct syntax for this

Linux 用户与组管理详解(system-config-users && 命令行)

孤街浪徒 提交于 2021-02-09 12:56:51
用户与组管理 什么是用户,用户是人吗? 用户是干啥的? 用户账号 超级管理员: root 普通用户: ruochen 系统/程序用户: 系统中为某个程序而产生的用户,这类用户一般不允许登录操作系统 组账号 定义: 用户的集合 基本组: 与用户同名的一个组 附加组: 将其他用户增加到某个组中,那么这个组称为其他用户的附加组 用户作用 Linux 基于用户身份对资源进行访问控制 UID 和 GID 号 uid(user identity) : 用户标识号 gid(group identity): 组标识号 root用户uid号: 0 普通用户uid号:1000-60000(rhel7) 500+(rhel6) 系统用户uid号: 1-999(rhel7) 1-499(rhel6) 用户相关文件 /etc/passwd 保存用户的账号信息 sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin ruochen:x:1000:1000:ruochen:/home/ruochen:/bin/bash 字段1: 用户账号名称 字段2: 'x' 代表密码占位符 /etc/shadow 字段3: 用户账号的uid号 字段4: 用户基本组账号的gid号 字段5: 用户的全名 字段6: 宿主目录(用户的家目录) 字段7:

Delete pattern from a variable with sed

折月煮酒 提交于 2021-02-09 12:28:13
问题 I am working with a script that has a variable called PRODUCT_VERSION . The version comes with a dot (for example 6.0 ). I need to remove the dot and save the result in another variable. So far I come with this, but it does not work correctly PRD_VER=$(sed "s/$PRODUCT_VERSION/\.//g") 回答1: $ PRODUCT_VERSION=6.0 $ PRD_VER=${PRODUCT_VERSION/.} $ echo $PRD_VER 60 Bash String Manipulation Examples 回答2: This might work for you (GNU sed & bash): NEW=$(sed 's/\.//g' <<<"$OLD") or NEW=$(echo "$OLD" |

Delete pattern from a variable with sed

♀尐吖头ヾ 提交于 2021-02-09 12:27:53
问题 I am working with a script that has a variable called PRODUCT_VERSION . The version comes with a dot (for example 6.0 ). I need to remove the dot and save the result in another variable. So far I come with this, but it does not work correctly PRD_VER=$(sed "s/$PRODUCT_VERSION/\.//g") 回答1: $ PRODUCT_VERSION=6.0 $ PRD_VER=${PRODUCT_VERSION/.} $ echo $PRD_VER 60 Bash String Manipulation Examples 回答2: This might work for you (GNU sed & bash): NEW=$(sed 's/\.//g' <<<"$OLD") or NEW=$(echo "$OLD" |

Delete pattern from a variable with sed

£可爱£侵袭症+ 提交于 2021-02-09 12:25:20
问题 I am working with a script that has a variable called PRODUCT_VERSION . The version comes with a dot (for example 6.0 ). I need to remove the dot and save the result in another variable. So far I come with this, but it does not work correctly PRD_VER=$(sed "s/$PRODUCT_VERSION/\.//g") 回答1: $ PRODUCT_VERSION=6.0 $ PRD_VER=${PRODUCT_VERSION/.} $ echo $PRD_VER 60 Bash String Manipulation Examples 回答2: This might work for you (GNU sed & bash): NEW=$(sed 's/\.//g' <<<"$OLD") or NEW=$(echo "$OLD" |

DC-2靶机渗透

狂风中的少年 提交于 2021-02-09 08:41:13
靶场下载链接: Download: http://www.five86.com/downloads/DC-2.zip Download (Mirror): https://download.vulnhub.com/dc/DC-2.zip Download (Torrent): https://download.vulnhub.com/dc/DC-2.zip.torrent ( Magnet) 提权辅助工具LinEnum下载: https://download.csdn.net/download/weixin_41082546/11609409 提权辅助工具linuxprivchecker下载: https://download.csdn.net/download/weixin_41082546/11609428 首先获取目标主机ip netdiscover -i eth0 -r 192.168.88.1/24 对端口进行扫描,只开放了web服务 于是访问web 这里配置本地dns解析,将目标ip地址添加进hosts 成功访问,发现是wordpress。 此处提示我们使用cewl生成一个通用的字典,并且告诉了我们flag的位置。 先使用dirb 做一个简单的目录扫描 dirb http://dc-2/ 发现后台地址 http://dc-2/wp-login.php?redirect

The way to detect the current mouse cursor type from bash or python

走远了吗. 提交于 2021-02-09 08:20:47
问题 I know that I can get the current location of the mouse cursor by executing "xdotool getmouselocation". I would like to detect the current mouse cursor type such as pointer, beam, or hand cursor from bash terminal or python code. Would this be possible? Thank you. June 回答1: You can use xdotool to continuously click where the link would be until the program notices the window title changes. When the window title changes, that means the link has been clicked, and the new page is loading.

The way to detect the current mouse cursor type from bash or python

旧街凉风 提交于 2021-02-09 08:18:26
问题 I know that I can get the current location of the mouse cursor by executing "xdotool getmouselocation". I would like to detect the current mouse cursor type such as pointer, beam, or hand cursor from bash terminal or python code. Would this be possible? Thank you. June 回答1: You can use xdotool to continuously click where the link would be until the program notices the window title changes. When the window title changes, that means the link has been clicked, and the new page is loading.

The way to detect the current mouse cursor type from bash or python

梦想与她 提交于 2021-02-09 08:18:15
问题 I know that I can get the current location of the mouse cursor by executing "xdotool getmouselocation". I would like to detect the current mouse cursor type such as pointer, beam, or hand cursor from bash terminal or python code. Would this be possible? Thank you. June 回答1: You can use xdotool to continuously click where the link would be until the program notices the window title changes. When the window title changes, that means the link has been clicked, and the new page is loading.

The way to detect the current mouse cursor type from bash or python

痞子三分冷 提交于 2021-02-09 08:17:27
问题 I know that I can get the current location of the mouse cursor by executing "xdotool getmouselocation". I would like to detect the current mouse cursor type such as pointer, beam, or hand cursor from bash terminal or python code. Would this be possible? Thank you. June 回答1: You can use xdotool to continuously click where the link would be until the program notices the window title changes. When the window title changes, that means the link has been clicked, and the new page is loading.