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
exportfs(8)						      System Manager's Manual						       exportfs(8)

NAME
exportfs - maintain table of exported NFS file systems SYNOPSIS
/usr/sbin/exportfs [-avi] [-o options,..] [client:/path ..] /usr/sbin/exportfs -r [-v] /usr/sbin/exportfs [-av] -u [client:/path ..] /usr/sbin/exportfs [-v] /usr/sbin/exportfs -f DESCRIPTION
An NFS server maintains a table of local physical file systems that are accessible to NFS clients. Each file system in this table is referred to as an exported file system, or export, for short. The exportfs command maintains the current table of exports for the NFS server. The master export table is kept in a file named /var/lib/nfs/etab. This file is read by rpc.mountd when a client sends an NFS MOUNT request. Normally the master export table is initialized with the contents of /etc/exports and files under /etc/exports.d by invoking exportfs -a. However, a system administrator can choose to add or delete exports without modifying /etc/exports or files under /etc/exports.d by using the exportfs command. exportfs and its partner program rpc.mountd work in one of two modes: a legacy mode which applies to 2.4 and earlier versions of the Linux kernel, and a new mode which applies to 2.6 and later versions, providing the nfsd virtual filesystem has been mounted at /proc/fs/nfsd or /proc/fs/nfs. On 2.6 kernels, if this filesystem is not mounted, the legacy mode is used. In the new mode, exportfs does not give any information to the kernel, but provides it only to rpc.mountd through the /var/lib/nfs/etab file. rpc.mountd then manages kernel requests for information about exports, as needed. In the legacy mode, exports which identify a specific host, rather than a subnet or netgroup, are entered directly into the kernel's export table, as well as being written to /var/lib/nfs/etab. Further, exports listed in /var/lib/nfs/rmtab which match a non host-specific export request will cause an appropriate export entry for the host given in rmtab to be added to the kernel's export table. OPTIONS
-a Export or unexport all directories. -o options,... Specify a list of export options in the same manner as in exports(5). -i Ignore the /etc/exports file and files under /etc/exports.d directory. Only default options and options given on the command line are used. -r Reexport all directories, synchronizing /var/lib/nfs/etab with /etc/exports and files under /etc/exports.d. This option removes entries in /var/lib/nfs/etab which have been deleted from /etc/exports or files under /etc/exports.d, and removes any entries from the kernel export table which are no longer valid. -u Unexport one or more directories. -f If /proc/fs/nfsd or /proc/fs/nfs is mounted, flush everything out of the kernel's export table. Fresh entries for active clients are added to the kernel's export table by rpc.mountd when they make their next NFS mount request. -v Be verbose. When exporting or unexporting, show what's going on. When displaying the current export list, also display the list of export options. DISCUSSION
Exporting Directories The first synopsis shows how to invoke exportfs when adding new entries to the export table. When using exportfs -a, all exports listed in /etc/exports and files under /etc/exports.d are added to /var/lib/nfs/etab. The kernel's export table is also updated as needed. The host:/path argument specifies a local directory to export, along with the client or clients who are permitted to access it. See exports(5) for a description of supported options and access list formats. To export a directory to the world, simply specify :/path. The export options for a particular host/directory pair derive from several sources. The default export options are sync,ro,root_squash,wdelay. These can be overridden by entries in /etc/exports or files under /etc/exports.d. A system administrator may override options from these sources using the -o command-line option on exportfs. This option takes a comma- separated list of options in the same fashion as one would specify them in /etc/exports. In this way exportfs can be used to modify the export options of an already exported directory. Unexporting Directories The third synopsis shows how to unexport a currently exported directory. When using exportfs -ua, all entries listed in /var/lib/nfs/etab are removed from the kernel export tables, and the file is cleared. This effectively shuts down all NFS activity. To remove an export, specify a host:/path pair. This deletes the specified entry from /var/lib/nfs/etab and removes the corresponding ker- nel entry (if any). Dumping the Export Table Invoking exportfs without options shows the current list of exported file systems. Adding the -v option causes exportfs to display the export options for each export. EXAMPLES
The following adds all directories listed in /etc/exports and files under /etc/exports.d to /var/lib/nfs/etab and pushes the resulting export entries into the kernel: # exportfs -a To export the /usr/tmp directory to host django, allowing insecure file locking requests from clients: # exportfs -o insecure_locks django:/usr/tmp To unexport the /usr/tmp directory: # exportfs -u django:/usr/tmp To unexport all exports listed in /etc/exports and files under /etc/exports.d: # exportfs -au USAGE NOTES
Exporting to IP networks or DNS and NIS domains does not enable clients from these groups to access NFS immediately. Rather, these sorts of exports are hints to rpc.mountd(8) to grant any mount requests from these clients. This is usually not a problem, because any existing mounts are preserved in rmtab across reboots. When unexporting a network or domain entry, any current exports to members of this group will be checked against the remaining valid exports and if they themselves are no longer valid they will be removed. FILES
/etc/exports input file listing exports, export options, and access control lists /etc/exports.d directory where extra input files are stored. Note: only files that end with .exports are used. /var/lib/nfs/etab master table of exports /var/lib/nfs/rmtab table of clients accessing server's exports SEE ALSO
exports(5), rpc.mountd(8), netgroup(5) AUTHORS
Olaf Kirch <okir@monad.swb.de> Neil Brown <neilb@cse.unsw.edu.au> 31 December 2009 exportfs(8)
All times are GMT -4. The time now is 05:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy