如何解决awk 第一列的数字范围匹配
在 FreeBSD 上,我想从 shell 脚本自动禁用除第一个 (ttyv0) 之外的所有控制台。这似乎用 AWK 比用 SED 更容易做到,但如果有人知道用 SED 做到这一点的方法,也请分享。
With awk this will work for a single console:
awk '/ttyv1/ { sub(/onifexists/,"off") } 1' /etc/ttys
However this will NOT:
awk '/ttyv{1-8}/ { sub(/onifexists/,"off") } 1' /etc/ttys
解决方法
根据您显示的尝试,请尝试以下操作。这应该会捕获 tty0 到 tty8 并进行相应的更改。
awk '/ttyv[0-8]/ { sub(/onifexists/,"off") } 1' /etc/ttys
,
在 sed 中很容易做到:
import { ToastContainer,toast,cssTransition } from 'react-toastify'
import 'react-toastify/dist/ReactToastify.css'
const bounce = cssTransition({
enter: 'animate__animated animate__bounceIn',exit: 'animate__animated animate__bounceOut',})
const App= () => {
return (
<ToastContainer
position="top-center"
autoClose={4000}
transition={bounce}
hideProgressBar
newestOnTop={false}
closeOnClick
rtl={false}
/>
)
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。