Question: Hello I am trying to output my useradd command instead of execute the function so that when I run my script it shows the useradd

Hello I am trying to output my useradd command instead of execute the function so that when I run my script it shows the useradd command but doesn't actually run it.

This is my script file that I am using #!/bin/bash

DATAFILE=$1

while IFS="," read USERNAME FIRSTNAME LASTNAME EMAIL IPADDRESS HIREDATE DEPARTM>

HIREDATE="$( date +'%A %B %d %Y')" EXPIRYDATE="$( date -d "$HIREDATE +3 years" +'%A %B %d %Y' )" USERADD="$(useradd -c "$EMAIL" -e "$HIREDATE" -m -s /bin/bash "$USERNAM>

echo " Useradd: $USERADD" echo " Username: $USERNAME" echo " Full Name: $FIRSTNAME $LASTNAME" echo " Department: $DEPARTMENT" echo " EMAIL: $EMAIL" echo " Hire Date: $HIREDATE" echo " Expiry Date: $EXPIRYDATE" echo " IP Address: $IPADDRESS" echo "---" done < $DATAFILE

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!