printing parameters from .profile


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting printing parameters from .profile
# 1  
Old 04-21-2008
printing parameters from .profile

Hi,
I have defined a few parameters in .profile. Here is how it looks like..

export ABC_HOME=/vol.nas/b20/abc/13.0/nm53/abc-13.0
export RFX_TMP=/vol.def/u50/abc/13.0/nm456/abc-13.0/tmp
export SQLPATH=:/dba/sql
export TEST_ABC_INTEGRATION_HOME=/home/txt/lms
export TEST_ABC_CONFIG_FILE=/home/txt/abc/config.xml
ORACLE_HOME=/u00/oracle/product/10.2.0
export ORACLE_HOME

PATH=$ORACLE_HOME/bin:$RFX_TMP:$RFX_HOME/bin:${PATH}

I need to write a shell script that prints few of these variables. Also to print the path some of the configura
This script should be reusable such that when other users log on to
their .profiles, they can also use this to print same variables.

Thanks,
neha
# 2  
Old 04-21-2008
You really should look for a tutorial, have you never echo the PATH variable? Google for "ksh scripting".

Regards
# 3  
Old 04-21-2008
echo is fine.. But how can this be made reusable.. So that any user can invoke it from his .profile
# 4  
Old 04-21-2008
Your requirements are too fuzzy to really understand where you want to go with this. Is there a particular subset of variables, or should users be able to pick and choose which ones they want to print? If the latter case, why not just teach them the basics of the shell so they can inspect the variables at will?

Assuming there is a fixed set of variables you want to print, how about

Code:
#!/bin/sh
set | egrep '^(ABC_HOME|SQLPATH|ORACLE_HOME)='

You could save this in /usr/local/bin/printvars and chmod a+x, assuming you don't already have a command by that name, and assuming your users are set up with /usr/local/bin in their PATH.

Last edited by era; 04-21-2008 at 02:08 PM.. Reason: Suggest to save script in /usr/local/bin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Remote login UNIX box from java passing parameters to the custom script called in the profile

Hello Good Day / Guten Tag.... I have to login the server and the user profile contains some scripts which need the inputs to be taken from the keyboard. So I use the method to conn.authenticateWithKeyboardInteractive(username, new InteractiveCallback() { public String... (1 Reply)
Discussion started by: Sanalkumaran
1 Replies

2. UNIX for Dummies Questions & Answers

Sco Unix printing : jobs hangs in queue - printing via lp versus hpnpf

Hi, We have a Unix 3.2v5.0.5. I installed a printer via scoadmin, HP network printer manager with network peripheral name (hostname and ipadres are in /etc/hosts). This is the configuration file : Code: root@sco1 # cat configurationBanner: on:AlwaysContent types: simpleDevice:... (0 Replies)
Discussion started by: haezeban
0 Replies

3. Windows & DOS: Issues & Discussions

Linux to Windows Printing: PDF starts printing from middle of page.

We are using Red Hat. We have a issue like this: We want to print from Linux, to a printer attached to a Windows machine. What we want to print is a PDF. It prints, but the printing starts from the middle of the page. In the report, there is no space at the top but still printing starts from the... (5 Replies)
Discussion started by: rohan69
5 Replies

4. AIX

tuning network parameters : parameters not persist after reboot

Hello, On Aix 5.2, we changed the parameters tcp_keepinit, tcp_keepintvl and tcp_keepidle with the no command. tunrestore -R is present in inittab in the directory /etc/tunables we can clearly see the inclusion of parameters during reboot, including the file lastboot.log ... (0 Replies)
Discussion started by: dantares
0 Replies

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

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. Shell Programming and Scripting

awk - printing parameters

Hello I've got a script that takes 2 parameters. id and f. id is a user id and f is a file. I want to print this id on the first line and then the file. how can this be done? thanks (3 Replies)
Discussion started by: jacma
3 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. 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

10. UNIX for Advanced & Expert Users

Printing Problems in unix ... ( Bar-cdoe - Ip Printing)

Hi guys ... i need ur help with some printing problem in unix ... first prob. : i wanna print from my NCR unix to an Win NT , Ip based printing server ( HP JetDirect ) . My issue , is it possible to print directly to an Ip address from unix ? How do i make it work to get any results ?... (3 Replies)
Discussion started by: QuickSilver
3 Replies
Login or Register to Ask a Question