Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

awk last word

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 :: change default path to open in termanl 
Shell :: ubuntu black screen recording 
Shell :: vim display the path 
Shell :: selinux apache 403 
Shell :: $ git update-index --chmod +x ./scripts/movefile.sh 
Shell :: stop kill network connection using cmd line 
Shell :: install ripgrep redhat 8 
Shell :: install sqitch 
Shell :: ssh welcome message ubuntu 
Shell :: flexlay editor 
Shell :: check value is number in cmd 
Shell :: groupadd to folder linux fedora 
Shell :: after restarting linux mac address resets 
Shell :: give names to ips on local machine ubuntu 
Shell :: cant download tree ubuntu windows 10 
Shell :: how to pass docker hub credentials for helm values.yaml 
Shell :: mac find exclude a directory 
Shell :: setup syslog-ng docker 
Shell :: git remove last merge commit 
Shell :: sonarcube exclude rule via powershell 
Shell :: linux head command get 2nd line 
Shell :: synology virtual machine install agent 
Shell :: complete command in zsh 
Shell :: fix errors occurred during update in linux 
Shell :: sqlmap enumerate databases for login page 
Shell :: install tag gz 
Shell :: deepstream boost jetson nano clock 
Shell :: make a batch file that accepts pipe input 
Shell :: cosmicjs 
Shell :: pipe find to rm 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =