AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

问题[powershell](ubuntu)

Martin Hope
Emma Vaze
Asked: 2020-10-08 06:18:03 +0800 CST

合并两个文件并聚合另一列

  • 0

我正在尝试根据 id 列比较两个文件,

A.txt 包含 ID、NAME 字段。

B.csv 包含 ID、NAME、PLACE、DATE、

我想从 a.txt 中找出哪个月份的 ID 最多

我正在尝试在 shell 命令中执行此操作。

command-line bash awk powershell
  • 1 个回答
  • 291 Views
Martin Hope
mongotop
Asked: 2020-07-25 16:06:33 +0800 CST

使用每个 JSON 对象值的正则表达式创建键值对并将其附加到 JSON 对象文件

  • 2

我有一个大文件,其中包含 json 对象,每个对象都在一个新行中。

文件示例

{"Name" :"%Hana-29-Mrs-Smith","job":"engineer"}
{"Name" :"%Mike-31-Mr-Larry","job":"marketing"}
{"Name" :"%Jhon-40-Mr-Doe","job":"engineer"}

期望的输出:

{"Name" :"%Hana-29-Mr-Smith", "f_nams":"Hana", "age":29, "title":"Mrs", "l_name":"Smith","job":"engineer"}
{"Name" :"%Mike-29-Mr-Larry", "f_nams":"Mike", "age":31, "title":"Mr", "l_name":"Larry","job":"marketing"}
{"Name" :"%Jhon-29-Mr-Smith", "f_nams":"Jhon", "age":40, "title":"Mr", "l_name":"Doe","job":"engineer"}
command-line regex powershell json
  • 2 个回答
  • 1389 Views
Martin Hope
rzippo
Asked: 2019-06-06 06:00:11 +0800 CST

在 Ubuntu 19.04 中将 Powershell 设置为登录 shell

  • 3

在 Ubuntu 19.04sudo apt install powershell中失败

The following packages have unmet dependencies:
 powershell : Depends: libssl1.0.0 but it is not installable
              Depends: libicu60 but it is not installable

安装它可以snap install powershell --classic工作,但是它没有出现,/etc/shells所以chsh不起作用。

如何解决这个问题?

powershell 19.04
  • 1 个回答
  • 2240 Views
Martin Hope
Thufir
Asked: 2018-02-18 02:15:39 +0800 CST

执行一个powershell脚本(hello world)

  • -2

一个powershell“hello world”脚本正在生成并使系统陷入困境:

Tasks: 413 total,   2 running, 411 sleeping,   0 stopped,   0 zombie
%Cpu(s): 42.8 us,  5.9 sy,  0.0 ni, 51.2 id,  0.2 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :  8126688 total,  1785632 free,  4862820 used,  1478236 buff/cache
KiB Swap:  8343036 total,  8343036 free,        0 used.  2875400 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND     
11915 thufir    20   0 3199524  76936  54220 S  19.2  0.9   0:00.58 b.sh        
11858 thufir    20   0 3068456  76988  54276 S  18.9  0.9   0:00.57 b.sh        
11820 thufir    20   0 3199516  77008  54292 S  18.5  0.9   0:00.56 b.sh        
11877 thufir    20   0 3330588  76796  54040 S  18.2  0.9   0:00.55 b.sh        
11896 thufir    20   0 3199532  76984  54232 S  18.2  0.9   0:00.55 b.sh        
11839 thufir    20   0 3199524  76808  54036 S  17.9  0.9   0:00.54 b.sh        
11934 thufir    20   0 3199520  77152  54360 S  17.9  0.9   0:00.54 b.sh        
10265 thufir    20   0 3609528 167556  83332 S   6.3  2.1   0:06.27 gnome-shell 
10002 thufir    20   0 3447780  86904  61024 S   4.6  1.1   0:00.72 b.sh        
 9965 thufir    20   0 3447764  86904  61036 S   4.3  1.1   0:00.69 b.sh        
 9982 thufir    20   0 3316688  86380  60528 S   4.3  1.1   0:00.71 b.sh        
10021 thufir    20   0 3447760  86548  60628 S   4.3  1.1   0:00.70 b.sh        
10040 thufir    20   0 3316696  86316  60524 S   4.0  1.1   0:00.71 b.sh        
10060 thufir    20   0 3316692  86680  60860 S   4.0  1.1   0:00.68 b.sh        
10080 thufir    20   0 3447768  85824  60020 S   3.3  1.1   0:00.66 b.sh        
 9948 thufir    20   0 3447768  86788  60792 S   3.0  1.1   0:00.66 b.sh        
11799 thufir    20   0 3068444  77012  54192 S   1.7  0.9   0:00.56 b.sh        

剧本:

thufir@dur:~$ 
thufir@dur:~$ cat powershell/weather/b.sh 
#!/usr/bin/pwsh -Command


echo "hello world"
"done"


thufir@dur:~$ 

不能让它成为一个可执行的脚本吗?也许这不是正确的第一行?

详细信息powershell:

thufir@dur:~$ 
thufir@dur:~$ pwsh
PowerShell v6.0.1
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/pscore6-docs
Type 'help' to get help.

PS /home/thufir> 
PS /home/thufir> $PSVersionTable.PSVersion                                                                              

Major  Minor  Patch  PreReleas BuildLabel 
                     eLabel               
-----  -----  -----  --------- ---------- 
6      0      1                           


PS /home/thufir> 
PS /home/thufir> get-host                                                                                               


Name             : ConsoleHost
Version          : 6.0.1
InstanceId       : 38ca179a-1605-49d3-8af2-15985d6c0536
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-CA
CurrentUICulture : en-CA
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace



PS /home/thufir> 
PS /home/thufir> $PSVersionTable                                                                                        

Name                           Value                                                                                   
----                           -----                                                                                   
PSVersion                      6.0.1                                                                                   
PSEdition                      Core                                                                                    
GitCommitId                    v6.0.1                                                                                  
OS                             Linux 4.13.0-32-generic #35-Ubuntu SMP Thu Jan 25 09:13:46 UTC 2018                     
Platform                       Unix                                                                                    
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                 
PSRemotingProtocolVersion      2.3                                                                                     
SerializationVersion           1.1.0.1                                                                                 
WSManStackVersion              3.0                                                                                     


PS /home/thufir> 
scripts programming microsoft webserver powershell
  • 1 个回答
  • 4363 Views
Martin Hope
Thufir
Asked: 2018-02-15 23:54:47 +0800 CST

如何在 Artful Aardvark 17.10 上安装 powershell?

  • -1

由于此错误,无法从 apt 为较新的Ubuntu版本安装 powershell吗?

$ cat /etc/apt/sources.list.d/microsoft.list
deb [arch=amd64] https://packages.microsoft.com/ubuntu/14.04/prod trusty main
$ sudo apt install -y powershell
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help resolve the situation:

The following packages have unmet dependencies:
 powershell : Depends: libicu52 but it is not installable
E: Unable to correct problems, you have held broken packages.

实际上,经过仔细检查,文档清楚地指出:

支持 Ubuntu 14.04、Ubuntu 16.04、Ubuntu 17.04

我在 17.10,系统中的microsoft.list文件应该是什么样的artful?

command-line apt microsoft 17.10 powershell
  • 1 个回答
  • 1420 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve