Hi All
How to do the below mentioned tasks using shell scripts I have two doubts
1.Let's consider file1.txt i need to edit the content of using vim editor for a specific line which has abc key word
in details
inside the file1.txt
10.20.3.5.7 xyhz yyzhhh
11.15.89.56 abc tgh
in the above file content i need change the ip which has the line abc key word . How to change it ?
2. how to do the sftp using shell script , sftp is passwordless?
regex in shell script
Re: regex in shell script
My two favourite program form file editing are mc (Midnight Commander) and Sublime which is "vim" on steroids which is great if you are looking for a specific line number.
Re: regex in shell script
Something like this:
Code: Select all
sed -r /abc/s/"(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])"/"192.168.1.1"/g file1.txt