Source .profile

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Source .profile
# 1  
Old 04-21-2014
Source .profile


I have a script which has to run by cron.The scripts runs fine by command line but not in cron. So I tried to source .profile but it doesn't seem to work.Please help I am beginner in unix

OS : Solaris 10
Shell : sh

I used the following command in shell scripts to source the file.

source /home/oracle/.profile

The path is correct and the file exists in the location.


Last edited by DukeNuke2; 04-21-2014 at 07:23 PM..
# 2  
Old 04-21-2014
Try changing:
source /home/oracle/.profile

. /home/oracle/.profile

This User Gave Thanks to Don Cragun For This Post:
# 3  
Old 04-21-2014
Explanation for any other newbie:

The source keyword exists in the bash shell, sh on Solaris 10 is not bash, so the source keyword will cause an error. Depending on how a crontab entry is set up, you may never be able to see errors. /usr/bin/mailx may show them in a recent email, if the cron entry runs under the account you are logged into.
These 2 Users Gave Thanks to jim mcnamara For This Post:
# 4  
Old 04-22-2014
Thanks a lot it worked
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Infrastructure Monitoring

trap in etc/profile and user .profile

Hello I really wonder what's trap in etc/profile and in each user .profile. I try to google for it but I think I have no luck. Mostly hit is SNMP traps which I think it is not the same thing. I want to know ... 1. What's a "trap 2 3" means and are there any other value I can set... (4 Replies)
Discussion started by: Smith
4 Replies

2. UNIX for Dummies Questions & Answers

difference between /etc/profile and .profile?

What is the difference between /etc/profile and .profile? (5 Replies)
Discussion started by: gehlnar
5 Replies

3. UNIX for Dummies Questions & Answers

Where can I read about the difference between "..profile" and ".profile"

Hi I know from reading O Riley's Classic Shell Scripting' that the .profile file is " the shells configuration file" but I am unable to find a reference to what "..profile" means. I have searched on the net, Sams Teach Yourself Unix, Unix Visual Quickstart Guide and Linux in a Nutshell. I have... (2 Replies)
Discussion started by: zorrokan
2 Replies

4. SCO

Difference between .profile and .~/.profile

what is the difference between these two lines, if we use it in korn shell script: .profile .~/.profile (3 Replies)
Discussion started by: maneesh mehta
3 Replies

5. UNIX for Dummies Questions & Answers

How to get to my .profile?

Hi, When I logon to UNIX I go to the root directory. I don't have an assigned user directory. I need to get to my .profile so that I can change things like command prompt. How do I do this? By the way I am using SUN Solaris Thanks. (3 Replies)
Discussion started by: GMMike
3 Replies

6. UNIX for Dummies Questions & Answers


Once I logged into the Unix Box the .profile does not work I need to enter .profile after I get the prompt to make it work. Could anyone give me an idea why it is happening like this. All your suggestions are greatly appreciated. (3 Replies)
Discussion started by: venkyA
3 Replies

7. UNIX for Advanced & Expert Users


I installed Red Hat 7.1. I found that .profile is not geting executed for any user. I checked the location of .profile . It is in home directory. What may be the reason. Thank you in advance!!! (3 Replies)
Discussion started by: j1yant
3 Replies

8. UNIX for Dummies Questions & Answers

changed .profile but didnt ./.profile, yet reflected changes

hi , i added ls -F to .profile. and i need to do ./.profile for the effect to take effect BUT i didnt and YET the next day when i came to work and log in, the changes took effect. i am on aix. please explain.. thanks (4 Replies)
Discussion started by: yls177
4 Replies

9. UNIX for Dummies Questions & Answers

why i have local.profile, local.cshrc,local.login instead of .profile, .login ?

Hello again ! Thanks for response of my first question. there is my second quesiton why i have local.profile instead of .profile file ? my all files in pwd shoes local. before any file. is anybody can tell me about that ? Thanks Abid Malik (5 Replies)
Discussion started by: abidmalik
5 Replies
Login or Register to Ask a Question

Featured Tech Videos