0

i have a homework:

The student should write a bash program named fix-permissions.sh that accepts a list of users as argument If a user or more are given as arguments, the script should reset files permissions as follows....

"accepts a list of users as argument" can someone explain it to me please?

1
  • somthing like:- yourscript user1 user2 user3 Commented Oct 17, 2010 at 22:38

2 Answers 2

3

That means if you input fix-permissions.sh user1 user2 user3 on the command line, your script will process these 3 users. In your script, you go through these arguments using $@

eg

for u in "$@"
do
  echo "$u"
done

please see man page on POSITIONAL PARAMETERS for more information

Sign up to request clarification or add additional context in comments.

1 Comment

Actually, in that case bash permits you to omit the in "$@" -- it will assume that if it doesn't see in <anything else>.
0

Positional parameters. $1, $2, $3, $@, etc.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.