我正在尝试根据 id 列比较两个文件,
A.txt 包含 ID、NAME 字段。
B.csv 包含 ID、NAME、PLACE、DATE、
我想从 a.txt 中找出哪个月份的 ID 最多
我正在尝试在 shell 命令中执行此操作。
我正在尝试根据 id 列比较两个文件,
A.txt 包含 ID、NAME 字段。
B.csv 包含 ID、NAME、PLACE、DATE、
我想从 a.txt 中找出哪个月份的 ID 最多
我正在尝试在 shell 命令中执行此操作。
我有一个大文件,其中包含 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"}
在 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
“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>
由于此错误,无法从 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
?