How the shell generates RPM package warehouse list file comparison results

Source: Internet
Author: User

Basic steps:

1. Switch to the warehouse directory Rpm_list_dir1 and RPM_LIST_DIR2

2. LS lists the RPM package files of the warehouse and redirects them to the output files Rpm_list_file1 and Rpm_list_file2 respectively.

3. Output the comparison results to the diff file Difff_file

Summarize:

The seemingly tricky things in code are all erased, and sometimes you are not the others, but yourself!

#!/bin/bash# version:1.0# Date:  2016/08/09# author:kevin chenemail: [email protected]rpm_list_dir1=]/home/ Desktop/ds_build/ds_x86-64_install/x86-64 "rpm_list_dir2="/home/install_x86-64/x86_64 "rpm_list_file1="/home/cxy /rpm_list_file1 "rpm_list_file2="/home/cxy/rpm_list_file2 "rpm_diff_file="/home/cxy/rpm_diff_file "# Generate the First RPM_LIST_FILE1CD $RPM _list_dir1count1= ' ls $RPM _list_dir1 | Wc-l ' ls $RPM _list_dir1 > $rpm _list_file1echo "There is $count 1 lines in Rpm_list_file1" # Generate the first rpm_list_ FILE2CD $RPM _list_dir2count2= ' ls $RPM _list_dir2 | Wc-l ' ls $RPM _list_dir2 > $rpm _list_file2echo "There is $count 2 lines in Rpm_list_file2" # Generate the Rpm_diff_file b Etween Rpm_list_file1 and Rpm_list_file2diff  -rnu $rpm _list_file1 $rpm _list_file2 > $rpm _diff_fileecho "the Difference between $RPM _list_dir1 and $RPM _list_dir2: "Cat $rpm _diff_file

The results of the implementation are as follows:

How the shell generates RPM package warehouse list file comparison results

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.