Article 5P3V3 creating shell script with passing command line arguments

creating shell script with passing command line arguments

by
ramsforums
from LinuxQuestions.org on (#5P3V3)
I have a remote server in which I have come education data.
I want to compare those files with local directories.

Assume my IP Address is 168.aaa.bbb.ccc
I am login as root

for copying I typically use this command line
rsync --protect-args -av root@168.aaa.bbb.ccc:/root/dl/2021\ Academy\ Registered/ /home/mervick/Downloads/dl/2021_Academy_Registered

For comparing, I found the following line of code will do that task

rsync -avun --delete ${TARGET}/ ${SOURCE} | sed -ne 's/^deleting *//p'

Now I want to create a shell script cmpdir.sh to compare two command line directories using following below command.
rsync -avun --delete ${TARGET}/ ${SOURCE} | sed -ne 's/^deleting *//p'

For example I will issue the following command
./cmpdir root@168.aaa.bbb.ccc:/root/dl/2021\ Academy\ Registered/ /home/mervick/Downloads/dl/2021_Academy_Registered

How do I implement the script?


Thankslatest?d=yIl2AUoC8zA latest?i=w_gpKeN1jl8:cMy6x-5oBFU:F7zBnMy latest?i=w_gpKeN1jl8:cMy6x-5oBFU:V_sGLiP latest?d=qj6IDK7rITs latest?i=w_gpKeN1jl8:cMy6x-5oBFU:gIN9vFww_gpKeN1jl8
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments