HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- . /etc/rc.config.d/cron
Operating System - HP-UX
1841192
Members
4021
Online
110179
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2007 03:03 PM
02-20-2007 03:03 PM
Hi all
Is it possible to execute a file with . /scriptname which don't have execute permisson.
When i was looking the /sbin/init.d/cron script. I saw a line.
if [ -f /etc/rc.config.d/cron ] ; then
. /etc/rc.config.d/cron
else
echo "ERROR: /etc/rc.config.d/cron defaults file MISSING"
fi
what it mean . /etc/rc.confgi.d/cron Is it executing the script. And the file cron dont have execute permission also.
Can anyone please brief me.
Regards,
Guna
Is it possible to execute a file with . /scriptname which don't have execute permisson.
When i was looking the /sbin/init.d/cron script. I saw a line.
if [ -f /etc/rc.config.d/cron ] ; then
. /etc/rc.config.d/cron
else
echo "ERROR: /etc/rc.config.d/cron defaults file MISSING"
fi
what it mean . /etc/rc.confgi.d/cron Is it executing the script. And the file cron dont have execute permission also.
Can anyone please brief me.
Regards,
Guna
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2007 04:11 PM
02-20-2007 04:11 PM
Solution
Please investigate the use of "?" in
questions.
In a Bourne (or Bourne-like) shell, ". file"
tells the current shell to read "file" and
to execute the commands in it. It does not
execute the script in the same way as a
simple "file" command, which would create a
new process running some shell which would be
reading "file".
". file" causes the current shell to read the
file, so only read permission is needed. For
example:
td176> cat ./z
echo fred
td176> ls -l z
-r--r--r-- 1 antinode 513 10 Feb 20 23:56 z
td176> ./z
sh: ./z: Execute permission denied.
td176> . ./z
fred
In a C shell, "source file" does the same
thing. See "man sh-posix".
questions.
In a Bourne (or Bourne-like) shell, ". file"
tells the current shell to read "file" and
to execute the commands in it. It does not
execute the script in the same way as a
simple "file" command, which would create a
new process running some shell which would be
reading "file".
". file" causes the current shell to read the
file, so only read permission is needed. For
example:
td176> cat ./z
echo fred
td176> ls -l z
-r--r--r-- 1 antinode 513 10 Feb 20 23:56 z
td176> ./z
sh: ./z: Execute permission denied.
td176> . ./z
fred
In a C shell, "source file" does the same
thing. See "man sh-posix".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2007 04:14 PM
02-20-2007 04:14 PM
Re: . /etc/rc.config.d/cron
To answer your question first question, "No" it is not possible to execute a file (at least directly) without the execute bit being set. However, you aren't asking the right question because the file to which you refer isn't being executed.
There is a profound difference between:
./etc/rc.config.d/cron
and
./etc/rc.config.d/cron
The first case, requires only read permission on the file while the second requires execute permission (and unless it is a true executable rather than a script, requires read permission as well).
The first case is using the shell's dot operator which has the effect of simply adding those lines to your existing script just as though they had been there all along. No child process is spawned and this means that if there is a return or exit statement in the file, the current process is terminated.
The second case actually spawns a separate process and anything such as variables being set occur in a child process and have no effect on the parent.
There is a profound difference between:
.
and
./etc/rc.config.d/cron
The first case, requires only read permission on the file while the second requires execute permission (and unless it is a true executable rather than a script, requires read permission as well).
The first case is using the shell's dot operator which has the effect of simply adding those lines to your existing script just as though they had been there all along. No child process is spawned and this means that if there is a return or exit statement in the file, the current process is terminated.
The second case actually spawns a separate process and anything such as variables being set occur in a child process and have no effect on the parent.
If it ain't broke, I can fix that.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP