Sponsored Content
Top Forums Shell Programming and Scripting When i am trying to execute export command within a shell script it is saying command not found. Post 302656591 by dchoudhury on Friday 15th of June 2012 03:00:36 AM
Old 06-15-2012
Error 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:
--------------------------

Code:
#!/bin/sh
user="test"
DIR="/bldtmp/"$user
VIEW="test.view1"
echo "TMPDIR before export :"$TMPDIR
MY_CMD='/usr/atria/bin/cleartool setview -exec "export TMPDIR='$DIR'/tmp;export UNPACKDIR='$TMPDIR'/unpackdir;echo After Export: $TMPDIR " '$VIEW
echo "cmd : " $MY_CMD
eval $MY_CMD


output coming :
---------------

Code:
TMPDIR before export :/var/tmp
cmd :  /usr/atria/bin/cleartool setview -exec "export TMPDIR=/bldtmp/test/tmp;export UNPACKDIR=/var/tmp/unpackdir;echo After Export: $TMPDIR " test.view1
export: Command not found.
Exit 1
export: Command not found.
Exit 1
After Export: /var/tmp


If i am directly specifying the export command inside the shell script, it is working, but when i am trying it through "/usr/atria/bin/cleartool setview -exec "export TMPDIR=/bldtmp/test/tmp;export UNPACKDIR=/var/tmp/unpackdir;echo After Export: $TMPDIR " test.view1" it is not working.

my shell version is:
Code:
GNU bash, version 3.00.15(1)-release (i386-redhat-linux-gnu)
Copyright (C) 2004 Free Software Foundation, Inc.

Please help me on this.

Thanks

Last edited by Franklin52; 06-15-2012 at 04:36 AM.. Reason: Please use code tags for data and code samples
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shell script to execute user command

I don't know why the following shell script doesn't work. Could you please help me out? #!/usr/bin/ksh test="cal > /tmp/tmp.txt 2>&1" $test I know it will work for the following format: #!/usr/bin/ksh cal > /tmp/tmp.txt 2>&1 However, I need to get the command from the user in... (1 Reply)
Discussion started by: redtiger
1 Replies

2. UNIX for Dummies Questions & Answers

ExporT Command Not found

Hi All I am getting and error export command not found What can be the possible reasons for this and how do we verify those Please help me Thanks (1 Reply)
Discussion started by: networking
1 Replies

3. Shell Programming and Scripting

write a shell script to execute a command

Hello all, I have just started doing shell scripting. I want to read a file which stores the status of my job I have submitted on a cluster. The file looks something like this : ========================FILE============================= crab: Checking the status of all jobs: please wait... (4 Replies)
Discussion started by: learn_linux
4 Replies

4. Shell Programming and Scripting

Execute a shell script after a particular command is run

Hi, I need to run a script whenever the Cron file is modified. The requirement is whenever a user modifies the cron file, the script should run automatically. Can you please provide your inputs ? (5 Replies)
Discussion started by: harneet2004us
5 Replies

5. Shell Programming and Scripting

rm:command not found in linux Bash shell script

Hi All, Linux lxs3er06 2.6.9-67.ELsmp #1 SMP Wed Nov 7 13:58:04 EST 2007 i686 i686 i386 GNU/Linux Issue: While executing shell scripts in bash shell, following error messages are thrown: rm:command not found On doing little investigation, I added '/bin' to $PATH and on doing echo... (9 Replies)
Discussion started by: a1_win
9 Replies

6. Shell Programming and Scripting

Command not found in shell script - stumped for 4 days

Hello, I like to begin with :wall:.. literally... It has been 4 days and I have no idea how to fix it. Environment - AIX 5.3 I wrote a script to call on ssh to log into another box via PKA to do something else. If I run the script on the terminal, it works 100%. If the SAP customised... (11 Replies)
Discussion started by: plonkagain
11 Replies

7. UNIX for Dummies Questions & Answers

ssh command to execute shell script in another server

ssh -q <hostname> /opt/tcs/satish/tst.ksh ssh -q <anotherserver> /opt/tcs/satish/tst.ksh tst.ksh has "nohup <command> & " when i execute below script , its throwing error as nohup can not be found ssh -q <anotherserver> /opt/tcs/satish/tst.ksh > log & can someone let me... (5 Replies)
Discussion started by: only4satish
5 Replies

8. UNIX for Dummies Questions & Answers

How to execute command after telneting in shell script?

Hi , I have to write a shell script to telnet to specific host and execute the admin command there. Please help me to do that. Eg : telnet hostname portno admin command exit (3 Replies)
Discussion started by: arukuku
3 Replies

9. Shell Programming and Scripting

Need to execute Oracle relocation command in shell script

Hello, I need to execute below command in shell script srvctl relocate service -d $database -s $service -i $avail -t $pref -f and also need to get the errors ,if any,in another file. What's the right way to execute such commands in shell script? Best regards, Vishal (1 Reply)
Discussion started by: Vishal_dba
1 Replies

10. Shell Programming and Scripting

How to execute application command in shell script?

friends, i have application commands to execute in shell script it is something like this. i will login with user data it takes me to $ prompt. Example given below login: data ps : xxxx $ MNSinput --this takes me to greater than prompt > > ops --this is command i enter this output... (7 Replies)
Discussion started by: udaykrishna
7 Replies
lorder(1)							   User Commands							 lorder(1)

NAME
lorder - find ordering relation for an object or library archive SYNOPSIS
lorder filename... DESCRIPTION
The input is one or more object or library archive filenames (see ar(1)). The standard output is a list of pairs of object file or archive member names; the first file of the pair refers to external identifiers defined in the second. The output may be processed by tsort(1) to find an ordering of a library suitable for one-pass access by ld. Note that the link editor ld is capable of multiple passes over an ar- chive in the portable archive format (see ar.h(3HEAD)) and does not require that lorder be used when building an archive. The usage of the lorder command may, however, allow for a more efficient access of the archive during the link edit process. The following example builds a new library from existing .o files. ar -cr library `lorder *.o | tsort` FILES
TMPDIR/*symref temporary files TMPDIR/*symdef temporary files TMPDIR usually /var/tmp but can be redefined by setting the environment variable TMPDIR (see tempnam() in tmpnam(3C)) ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWbtool | +-----------------------------+-----------------------------+ SEE ALSO
ar(1), ld(1), tsort(1), tmpnam(3C), ar.h(3HEAD), attributes(5) NOTES
lorder will accept as input any object or archive file, regardless of its suffix, provided there is more than one input file. If there is but a single input file, its suffix must be .o. The length of the filename for TMPDIR is limited to whatever sed allows. SunOS 5.10 29 Oct 1991 lorder(1)
All times are GMT -4. The time now is 02:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy