Question
Assume that you have written a script named checkLogins.sh that parses the utmp and btmp files, and then builds a report of suspicious activity. You
Assume that you have written a script named checkLogins.sh that parses the utmp and btmp files, and then builds a report of suspicious activity. You want run this command monthly, but each month you want to save a new copy of the file. To accomplish this you decide to save this report in a file that always begins with the string suspicious but ends with a string that identifies the date the report was created. The date string should be a 6 digit number with the first 4 numbers representing the year and the last 2 numbers representing the month. For example if the date is April 1, 2077 the file name would be suspicious.207704. Within your script you have a variable named currentDate that you want to hold the date string. What commands would you use in the script to set the value of currentDate to the required date string? Note - you're not building the entire filename, just the date string.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started