Attemp to call the .profile


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Attemp to call the .profile
# 1  
Old 01-22-2019
Attemp to call the .profile

i have this line of code on my script

Code:
#!/bin/sh

#enable the environment variable thru profile 
. .profile

when i run the script it was unable to find the .profile
Code:
 sh ChgPwd.sh
ChgPwd.sh: line 4: .: .profile: file not found

the file .profile exists
Code:
 ls -altr .profile
-rw-r--r-- 1 _wtolentino domain users 700 Jan 11 08:40 .profile

at the command line i can call it
Code:
 . .profile

our OS version is:
Linux 2.6.32-696.10.1.el6.x86_64 GNU/Linux

please help thank you.

Last edited by wtolentino; 01-22-2019 at 02:38 PM..
# 2  
Old 01-22-2019
. ~/.profile
This User Gave Thanks to vgersh99 For This Post:
# 3  
Old 01-22-2019
Or alternatives:
. "$HOME"/.profile, or source "$HOME"/.profile
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How do i call aliases from my .profile?

Hello all, Please my shell is ksh. I created .profile such that users can pick environments they want to use: echo Select your Environment!! echo " 1. Nigeria DEV" echo " 2. UEMOA DEV" echo " 3. CEMOA DEV" echo "Make your choice : \c" read choice if then ... fi if then (6 Replies)
Discussion started by: mofaloks
6 Replies

2. UNIX for Advanced & Expert Users

Can we call crontab -e into .profile?

Hi All, I have a doubt that can we call under whatever scripts we mention in crontab -e into .profile . Because every weekend my server is going to restart so, my doubt whether crontab -e will automatically run my scripts or manually we have to save the crontab -e again? If that crontab... (3 Replies)
Discussion started by: ksrivani
3 Replies

3. Shell Programming and Scripting

Call .profile in perl script

Hello Gurus Can anyone please let me know how to call .profle file in perl script When I am calling the .profile file its giving error Shall I create unix script which has .profile command and call perl script internally (2 Replies)
Discussion started by: Pratik4891
2 Replies

4. 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

5. Infrastructure Monitoring

diffrence between method call and function call in perl

Hello, I have a problem with package and name space. require "/Mehran/DSGateEngineLib/general.pl"; use strict; sub System_Status_Main_Service_Status_Intrusion_Prevention { my %idpstatus; my @result; &General_ReadHash("/var/dsg/idp/settings",\%idpstatus); #print... (4 Replies)
Discussion started by: Zaxon
4 Replies

6. 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

7. UNIX for Advanced & Expert Users

how to differentiate system call from library call

Hi, Ho do I differentiate system call from library call? for example if I am using chmod , how do I find out if it is a system call or library call? Thanks Muru (2 Replies)
Discussion started by: muru
2 Replies

8. 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

9. Shell Programming and Scripting

How to call .profile in cron?

Hello all, I want to call my users .profile in cron? I understand that i have to do it explicitly in crontab entry. How can we do it ? How can i write a simple script calling it? Thanks & Regards Abhijeet (15 Replies)
Discussion started by: abhijeetkul
15 Replies

10. 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
Login or Register to Ask a Question