我有一个脚本,可以打印出有关正在运行的作业的信息。 我有兴趣获取名称和状态(等待/运行) 它们位于不同的行(状态在名称下方)
[Authorize]
public IActionResult SignIn()
{
return Challenge(new AuthenticationProperties { RedirectUri = "/" }, OpenIdConnectDefaults.AuthenticationScheme);
}
name = any_name
我尝试过:
status = Wait
如何同时显示状态和名称?
答案 0 :(得分:1)
样本数据文件:
data = [d.replace('\"', '') for d in data]
在{grep和awk)之后搜索test
name = any_name
status = Wait
some data
和grep行
name
搜索grep -A 1 "name" file
awk '/name/ {p=2} p--' file
name = any_name
status = Wait
和grep行(grep和awk)之前
status
答案 1 :(得分:0)
modelBuilder.Entity("GenerateCodeFromDB.DB_Modell.TblTest", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("ID")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<DateTime?>("Date");
b.Property<string>("Name")
.HasMaxLength(50);
b.Property<int?>("Number");
b.HasKey("Id");
b.ToTable("tblTest");
});
应该做好这项工作。
来自grep的联机帮助页:
打印NUM行输出上下文。