我想这样的GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu):
$ echo <<EOF | cat
> 1
> 2
> 3
> EOF
Run Code Online (Sandbox Code Playgroud)
我本来期望输出三行(带有1, 2, 3),但我收到一个空行。我错过了什么(可能是一个简单的错误)?我知道可以以更简单的方式生成此特定输出;该示例应作为更实质性应用的蓝图。
我想使用Perl在文件的每一行上运行shell命令.该文件包含诸如的包名firefox.
这是对单个包名称的调用; 有用:
dpkg-query -W -f='${binary:Package}_${Version}' firefox
Run Code Online (Sandbox Code Playgroud)
如果我从这样的单行"文件"管道它不再起作用:
echo firefox | perl -ne \
'print `dpkg-query -W -f="${binary:Package}_${Version}" $_` . "\n"'
Run Code Online (Sandbox Code Playgroud)
输出是_\n.那么在这些嵌套引号中逃避这些美元的正确方法是什么,以便dpkg-query接收${binary:Package}_${Version}不带shell 的bba 或bash将它们解释为"他们的"变量的逐字字符串?我尝试了各种排列但到目前为止无济于事.输出应该是表格firefox_59.0.2+build1-0ubuntu0.16.04.1\n.
I have configured a user my_user who belongs to my_group in Keycloak 4.8.3. I have then obtained an id token for it with grant type Resource Owner Password Credentials (ROPC). When I inspect the issued id token with a tool such as jwt.io I can see that the user's id and name are included as JWT clains sub and preferred_username respectively.
But where does group membership show up inside the JWT?
我需要移植一个短脚本bash来dash(即shDebian的10下)。它包含以下行:
chown root:www-data /etc/nginx/conf.d && chmod 775 $_
Run Code Online (Sandbox Code Playgroud)
这现在失败了,因为$_保留了上一个命令的最后一个参数(即/etc/nginx/conf.d),bash但现在使用 non-interactive 保留了不同的值dash。作为另一个例子,从bash -c 'echo 1 2 && echo $_'和 的输出dash -c 'echo 1 2 && echo $_'也不同。
形成上述类型的“简洁”语句的典型方法是什么dash(不诉诸更专业的命令,例如install)?