DevOps home task description:
Please write a bash script with 2 functions first function will return the list of files in a folder in ascending order.
second function will return the list of files in a folder in descending order.
the bash program will get as a parameter the requested operation, and the folder full path,
and outputs the function results.
keep in mind syntax validation
Please write a bash one-liner command that will test if a range of ip addresses in a 24 subnet range is occupied for example: give the cidr 10.5.99.0/24
you should print out back which ip addresses are taken.
Guidelines:
-
a trial to test if address is occupied is sufficient
-
do not print the trial, print a message only if you find an occupied address which includes the address.
for example: "ip 10.5.99.20 is occupied"
Write a bash or python (your choice) script that checks for files that are duplicates, even if they have a different name, and does so for directories specified by the user - duplicate files required to have same file name or equal data(one of the temrs) ?
Python - Validate a list of credit cards from AAAA Bank which have the following characteristics: It must start with a 4,5 or 6 It must contain exactly 16 digits It must only consist of digits (0-9) It may have digits in groups of 4, separated by one hyphen "-" It must NOT use any other separator like ' ' , '_', etc It must NOT have 4 or more consecutive repeated digits Examples:
Valid Credit Card Numbers
4254625873615486
5535535535553555
5322-2348-7964-3124
Invalid Credit Card Numbers
42546258776197837 #17 digits in card number → Invalid
2215555513331333 #Consecutive digits are repeating 4 or more times → Invalid
5322-2348-7974 - 3124 #Separators other than '-' are used → Invalid
44155x4423332333 #Contains non digit characters → Invalid
0535372585962598 #Doesn't start with 4, 5 or 6 → Invalid