How to export a command ?

Thread Tools Search this Thread
# 1  
Question How to export a command ?


The command "ssh -V" works as normal user but fails as root.

As Normal user:
bash-3.00$ ssh -V
OpenSSH_5.9p1, OpenSSL 1.0.0e 6 Sep 2011

As Root user:
# ssh -V
bash: ssh: command not found


Last edited by methyl; 02-07-2012 at 09:32 AM.. Reason: please use code tags
# 2  
Clearly the path to "ssh" is not in $PATH for the root user.
In each account, check this with:
type ssh
echo $PATH

Then try typing the full path to "ssh" in the "root" account to prove the theory.

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Explaination on export command

Hello Team, Could you pls explain how export command works in below code: for i in ${!SDV_*}; do export $i done As per my understanding, if SDV_1=test1;SDV_2=test2;test1=var1;test2=var2then in for loop below export will get executed. export var1;export var2But, Will this... (3 Replies)
Discussion started by: chandana.hs
3 Replies

2. Shell Programming and Scripting

When i am trying to execute export command within a shell script it is saying command not found.

I am running the export command within a view to use that value inside my build script. But while executing it it is saying "export command not found" My code is as follows: -------------------------- #!/bin/sh user="test" DIR="/bldtmp/"$user VIEW="test.view1" echo "TMPDIR before export... (4 Replies)
Discussion started by: dchoudhury
4 Replies

3. Shell Programming and Scripting

Need help for export command

Hi, I need help for using export command. Lets consider there are 2 servers ie. A & B. I am running one script on server A which calls another script on server B using remsh command. There is one variable in the script on server B which do not gets evaluated and ultimately i get the error. ... (3 Replies)
Discussion started by: tushar_shah06
3 Replies

4. UNIX for Dummies Questions & Answers

Problem with export command

hello all, I know this is a silly question but i have no answer. I have a shell script temp.ksh export value="mynh" echo $value but when i execute the temp.ksh "mynh" is printed but when i give echo $value in the shell after the program is executed, nothing is printed. ... (3 Replies)
Discussion started by: anijan
3 Replies

5. Shell Programming and Scripting

Export Command

Hello All, I am transferring a file from one server to another server. File name is stored as Wip_DD-MM-YY .i.e if we run the program today the file is stored as Wip_18-FEB-09.txt. This file i need to transfer. My question is how do we assign the this filename to a variable. i treid in... (3 Replies)
Discussion started by: chpraveen_862
3 Replies

6. Shell Programming and Scripting

error while using export command

Hi All, In my script i am using data from oracle table for validation. #!/bin/sh export UID=dun_ind export PWD=`getID dun_ind` fed_ctrl=`sqlplus -s $UID/$PWD@lms <<END set feedback off; set heading off; select sta from controls where sta = 'ABC'; EXIT; END` echo $fed_ctrl... (1 Reply)
Discussion started by: Amit.Sagpariya
1 Replies

7. Shell Programming and Scripting

awk/sed Command : Parse parameter file / send the lines to the ksh export command

Sorry for the duplicate thread this one is similar to the one in Since there were no responses on the parent thread since it got resolved partially i thought to open the new... (4 Replies)
Discussion started by: rajan_san
4 Replies

8. UNIX for Advanced & Expert Users

Export command

Hi all, Want to know what does export command do?? What is its functionality? And on a shell prompt $at=1 $ echo $at 1 The variable above is it available to other script??? (3 Replies)
Discussion started by: prakash.kudreka
3 Replies

9. UNIX for Dummies Questions & Answers

export command

Is there any difference between these 2 commands :- export var="a" and var="a" export var (2 Replies)
Discussion started by: radhika03
2 Replies

10. Shell Programming and Scripting

using export command

I saw a unix shell script in which export command is used like this : export filename what is a file exported for ? thanks srini (4 Replies)
Discussion started by: sveera
4 Replies

Featured Tech Videos