A
A
a000_000a2018-05-11 10:23:02
bash
a000_000a, 2018-05-11 10:23:02

What does this case mean?

Please explain what does "-u=*|--user=*)" mean, what are "shift" and ";;" for?
case $i in
-u=*|--user=*)
USER="${i#*=}"
shift
;;
esac

Answer the question

In order to leave comments, you need to log in

1 answer(s)
3
3vi1_0n3, 2018-05-11
@a000_000a

1) This means that the case should work if the variable i has a value starting with the string "-u=" or with the string "--user="
2) shift shifts the positional parameters, deleting the very first one. For example, the script is called like this:
The positional parameters are as follows:

$1=1
$2=2
$3=3

After the shift command:
$1=2
$2=3
$3 пустой

3) ;; - this is part of the case structure, means the end of the list of commands included in this case.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question