1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
weeeeeb [17]
3 years ago
11

Write a BASH script to create a user account.  The script should process two positional parameters: o First positional paramete

r is supposed to be a string with user name (e.g., user_name) o Second positional parameter is supposed to be a string with user password (e.g., user_password)  The script should be able to process one option (use getopts command): o Option -f arg_to_opt_f that will make your script direct all its output messages to file -arg_to_opt_f
Computers and Technology
1 answer:
Marianna [84]3 years ago
7 0

#!/bin/bash

usage() {

       echo "Usage: $0 [ -f outfile ] name password" 1>&2

       exit 1

}

while getopts "f:" o; do

       case "${o}" in

       f)

               filename=${OPTARG}

           ;;

       *)

               usage

           ;;

   esac

done

shift $((OPTIND-1))

name=$1

password=$2

if [ -z "$password" ] ; then

       usage

fi

set -x

if [ -z "$filename" ] ; then

       useradd -p `crypt $password` $name

else

       useradd -p `crypt $password` $name > $filename

fi

You might be interested in
What is qwerty and why is it on the keyboard?
Genrish500 [490]

Answer:

qwerty is the main way people sort out there keyboard as you can see on the left side of the keyboard there is W,A,S,D

Explanation:

6 0
4 years ago
Read 2 more answers
____ are likely in the event of a hacker attack, when the attacker retreats to a chat room and describes in specific detail to h
Masja [62]

Answer:

Follow-on incidents.

Explanation:

When the hacker hacks something successfully and after that when he or she  discusses or describes the details to his or her associates and the method which he or she used to do the hacking is called Follow-on incidents because the hacker has successfully completed his or her conquest the event is happening after that.

4 0
4 years ago
An attribute is a(n)?
steposvetlana [31]

Answer:

hjqnajiwjahhwhaiwnaoai

6 0
3 years ago
Read 2 more answers
Before you can use the Management Studio to work with the objects in a database, you must ___________ the database files (i.e.,
Lelu [443]

Answer:

You must attach the database files

Explanation:

4 0
3 years ago
Given the variables costOfBusRental and maxBusRiders of type int , write an expression corresponding to the cost per rider (assu
Liono4ka [1.6K]

Answer:

       int costOfBusRental;

       int maxBusRiders;

       int costPerRider;

       costPerRider = costOfBusRental/maxBusRiders;

Explanation:

The costPerRider is the total cost of renting the bus (costofBusRental) divided by all the bus users (maxBusRiders). So we declare the three variables to be of type int as required by the question.

7 0
4 years ago
Other questions:
  • Steps needed to deposit cash on cash deposit machine
    6·1 answer
  • Your recovery/recycling machine has r-502 refrigerant in it. you now have to recover refrigerant from a unit with r-22. what mus
    12·1 answer
  • The presentation ____ determines the formatting characteristics of fonts and colors.
    11·2 answers
  • Write a program that prompts the user to input a number. The program should then output the number and a message saying whether
    10·1 answer
  • The two main methods of verification
    6·1 answer
  • A small group of travelers is meeting inside an ancient building, and the travelers need access to the Internet using their mobi
    13·1 answer
  • Why do you think it is necessary to set the sequence in which the system initializes video cards so that the primary display is
    15·1 answer
  • Write a try block in which you prompt the user for an integer and display the name in the requested position in the names array.
    11·1 answer
  • What is a megavirus in computing
    8·2 answers
  • For which of the four game elements will you give a detailed description about the challenges that the player will face, such as
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!