Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

awk get last argument

You can use $NF with the command awk to get the last argument as follows:
awk -F 'delimiter' '{print $NF}'
And for getting penultimate or previous arguments type $(NF-n):
awk -F 'delimiter' '{print $(NF-1)}' #penultimate argument
Comment

PREVIOUS NEXT
Code Example
Shell :: aws elastic container service login 
Shell :: godot mask over mask 
Shell :: command to fix frozen shell 
Shell :: install virtualenv ubuntu 18.04 stackoverflow 
Shell :: hack+0000000000000000000000000000000000000000+sha1+master+git 
Shell :: change data type powershell 
Shell :: tcpdump localhost 
Shell :: <bits/types/__fpos_t.h no such file or directory 
Shell :: wget quier 
Shell :: head until last line 
Shell :: check commmit version 
Shell :: guard-rspec 
Shell :: gimp : Dépend: libgimp2.0 (= 2.10.18) mais ne sera pas installé Dépend: libgimp2.0 (<= 2.10.18-z) mais ne sera pas installé Dépend: libgegl-0.4-0 (= 0.4.22) mais ne sera pas installé 
Shell :: ssms linux install terminal stack overflow 
Shell :: interface grafica biblioteca WIN32 em Linguagem c 
Shell :: fslstats 
Shell :: grafana loki windows 
Shell :: gitlab stale branches api script 
Shell :: Errors were encountered while processing: linux-image-5.4.0-71-generic linux-image-5.4.0-70-generic 
Shell :: install pusher srever in larvel 
Shell :: copy file from windows to linux permission denied wsl 
Shell :: How can I become the owner of a file/folder that root owns? 
Shell :: how to change expiry date for user linux 
Shell :: install-lamp-stack-ubuntu-20-04-server-desktop 
Shell :: windows virtualenv pip numpy problem 
Shell :: como instalar ext-mbstring en ubuntu 18.04 
Shell :: how to install gatsby transformer plugin 
Shell :: ubuntu record video change time 
Shell :: how to rollback to 20h2 
Shell :: bash silent errors 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =