The .profile was the original profile configuration for the Bourne shell (a.k.a., sh). bash, being a Bourne compatible shell will read and use it.
Any shell providing bourne compatibility will read .profile.
and thus, I believe is C true.
-rw-r--r-- 1 ubuntu ubuntu 807 Jan 6 16:23 .profile
A. It must be executable. (Wrong it is not)
B. It must call the binary of the login shell. (No it is not necessary)
C. It must use a valid shell script syntax. (correct)
D. It must start with a shebang. (Wrong it does not start by shebang, it is called from /etc/profile file)
E. It must be readable for its owner only. (Wrong it is not)
E is correct imho: The .profile file does not start with a !# so it does not follow shell scripting syntax. It does not need to be executable. The standard permissions are set to -rw-r--r-- so actually it is readable for everyone, but because it is in the users directory only the user is able to read it. I think that, because of the other answers are definitively not right, E is the most sane answer. Still an annoyingly confusing question though..
C is correct ...E is wrong because ALL have Read permission check yourself on linux box
D is WRONG as it doesnt not need to start with SHE Bang!!! oops typo Shebang..below is cut/paste of the actual file
root@Debian:~# cat .profile
# ~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
mesg n 2> /dev/null || true
I think I am misunderstanding something then, wouldn't valid shell script syntax include a shebang, so that would mean if c is true, then d must be true as well?
I think all are misunderstanding the question.
Everywhere the answer is C, but I think it is wrong and the permission is asked here.
It must be r for all or user!
I would go with E
And
Syntax is meant # !/bin/bash or what ever.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Vendo
Highly Voted 2 years, 10 months agochris12aug
Highly Voted 1 year, 1 month agoMchoeti
Most Recent 3 months, 1 week agoNetOps_Dave
1 year, 1 month agoMaikyCR28
1 year, 1 month agolucaverce
1 year, 2 months agoLazylinux
1 year, 3 months agodspaula
1 year, 4 months agoRobert12
1 year, 5 months agoshahab
2 years, 5 months agosigi63
2 years, 7 months agorb1353
2 years, 7 months agosoullessone
1 year, 5 months agosoullessone
1 year, 5 months agoilputto
2 years, 7 months ago