Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

get last line from string powershell

(gc "c:myfile.txt") | % -Begin {$test = (gc "c:myfile.txt" | select -first 1 -last 1)} -Process {if ( $_ -eq $test[0] -or $_ -eq $test[-1] ) { $_ -replace "-" } else { $_ }} | Set-Content "c:myfile.txt"
Comment

PREVIOUS NEXT
Code Example
Shell :: If you do not have Xcode installed, download and install it from App Store and run it once to complete its setup 
Shell :: how to install nipe 
Shell :: msys2 install zsh 
Shell :: ng serve all interfaces 
Shell :: Zim files from command prompt 
Shell :: how to install random module in python 
Shell :: Enum install 
Shell :: sftp with private key cli 
Shell :: how to uninstall Gnome System Monitor 
Shell :: run .c file linux 
Shell :: powershell invoke 
Shell :: mac console dir 
Shell :: bash rest of arguments 
Shell :: vsftpd create user for mac 
Shell :: Explain how repos work, referencing the .git file 
Shell :: awk print first characters of a field 
Shell :: facebook signin does not working on facbook app works only when no app is installed 
Shell :: ubuntu dpkg path 
Shell :: active directory user kopieren per powershell 
Shell :: octal notation in linu 
Shell :: find in output windows cmd 
Shell :: git needs merge 
Shell :: how to pass k8s secret in run command line 
Shell :: opera mini for ubuntu 18.04 
Shell :: install wsl windows 11 
Shell :: ubuntu install jitsi 
Shell :: delete all git ignored files 
Shell :: delete .lastupdated maven 
Shell :: sudo bash 
Shell :: how will you clone the following git repository using git cli? 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =