Sponsored Content
Top Forums Shell Programming and Scripting Whats does this export command do? Post 302512822 by aster007 on Monday 11th of April 2011 04:49:49 PM
Old 04-11-2011
This can be divided into 2 parts

Code:
export ROWSTOLOAD=${ROWSTOLOAD:--100}

If "ROWSTOLOAD" is defined then
Code:
export ROWSTOLOAD=${ROWSTOLOAD}

else set it to
Code:
export ROWSTOLOAD=-100

In general if a variable is needed to be exported but you don't know if its already defined then you use the above syntax to define it to a default value in case it is not set.
Suppose you have variable "VAR" and not sure if it already had some value, but you want it to be defaulted to "300" if it's not defined, then you use the command

Code:
export VAR=${VAR:-300}

These 3 Users Gave Thanks to aster007 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Whats the Vhost Command for the Unix Shell

anyone know? would be greatly thankful. (4 Replies)
Discussion started by: shellnewbie
4 Replies

2. Solaris

Whats the command to see

What fonts are installed on a Solaris 8? I have no GUI so a command line command would be great. Thank you (2 Replies)
Discussion started by: Acleoma
2 Replies

3. Programming

whats the command in unix

what is the command to print the text in a specifed location eg i have text ("i am here"); i have to print it on location 20,20 wat is the command and which header file it uses i am currentlr working in solaris 5.8 using unix (1 Reply)
Discussion started by: ramneek
1 Replies

4. Shell Programming and Scripting

Whats wrong with the mv command

I am sorry guys I have figured out the error myself. (0 Replies)
Discussion started by: dsravan
0 Replies

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

6. UNIX for Advanced & Expert Users

whats command for search including sub directory ?

What is the command for search the program name from the entire directory (all directories in the unix box, means including sub directories...) (2 Replies)
Discussion started by: gksenthilkumar
2 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 https://www.unix.com/shell-programming-scripting/88132-awk-sed-script-read-values-parameter-files.html#post302255121 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 Dummies Questions & Answers

How to export a command ?

Hi 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 2011As Root user: # ssh -V bash: ssh: command not found Thanks (1 Reply)
Discussion started by: frintocf
1 Replies

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

10. Shell Programming and Scripting

There's a unknown command on line 1 and i don't know whats causing it.

My OS is Linux GL version 2.4.26. I am trying to make a shell script that outputs a chart displaying info of who is online, boot time, and the real time, I have manage to get it to work, but I still get the error "./user/script: line 1: : command not found." I do in fact have access to root, if... (2 Replies)
Discussion started by: thatguy565
2 Replies
export(1m)																export(1m)

NAME
export - Exports binding information for an interface identifier or object UUIDs or both to a server entry; if the specified entry does not exist, creates the entry SYNOPSIS
rpccp export entry-name {-i if-id -b string-binding [-b string-binding...] -o object-uuid [-o object-uuid...] | -i if-id -b string-bind- ing [-b...] | -o object-uuid [-o object-uuid...] } [-s syntax ] OPTIONS
Declares the interface identifier of an RPC interface. The export command operates on only one -i option; if you enter more than one, the command ignores all but the last interface identifier. If you specify an interface identifier, you must specify at least one -b option. The -i and -o options can occur together or separately, but one of them is necessary. The interface identifier takes the following form: interface-uuid,major-version.minor-version The version numbers are optional, but if you omit a version number, the value defaults to 0. The UUID is a hexadecimal string and the version numbers are decimal strings, for example: -i ec1eeb60-5943-11c9-a309-08002b102989,3.11 Leading zeros in version numbers are ignored. Declares a string binding (optional). To use this option, you must also specify an interface identifier (using the -i option). Each command accepts up to 32 -b options. The value has the form of an RPC string binding, without an object UUID. The binding information contains an RPC protocol sequence, a net- work address, and sometimes an endpoint within brackets (rpc-prot-seq:network-addr[endpoint]). For a well-known endpoint, include the end- point in the string binding, for example: -b ncadg_ip_udp:63.0.2.17[5347] For a dynamic endpoint, omit the endpoint from the string binding, for example: -b ncacn_ip_tcp:16.20.15.25 Note that depending on your system, string binding delimiters such as brackets ([ ]) may need to be preceded by an escape symbol () or placed within quotation marks (' ' or `` ''). Requirements vary from system to system, and you must conform to the usage rules of a system. Declares the UUID of an object. Each export command accepts up to 32 -o options. The -i and -o options can occur together or separately, but one of them is necessary. The UUID is a hexadecimal string, for example: -o 3c6b8f60-5945-11c9-a236-08002b102989 Indicates the name syntax of the entry name (optional). The only value for this option is the dce name syntax, which is the default name syntax. Until an alternative name syntax becomes available, specifying the -s option is unnecessary. ARGUMENTS
Specifies the name of the target name service entry. Usually, the target is a server entry. However, objects also can be exported (with- out an interface identifier or any binding information) to a group or a profile. For an entry in the local cell, you can omit the cell name and specify only the cell-relative name. DESCRIPTION
The export command places binding information and an interface identifier, object UUIDs, or both into a server entry, or the command object UUIDs into a group's entry. The export command searches the name service database for the entry with the specified entry name. If the entry exists, the command uses it; otherwise, the command tries to create a new name service entry using the specified entry name. Minimally, the command requires the name of the entry and either an identifier and binding string or an object. If the specified entry does not exist, the export command tries to create the entry. Privilege Required You need both read permission and write permission to the CDS object entry (the target name service entry). If the entry does not exist, you also need insert permission to the parent directory. NOTE
This command is replaced at Revision 1.1 by the dcecp command and may not be provided in future releases of DCE. EXAMPLES
This example shows a control program export command that is stored in a file for later execution from the system prompt. The command exports two objects and an interface with two string bindings to the server entry /.:/LandS/anthro/Cal_host_3 in the local cell: # file to export Calendar 1.1 at installation time rpccp export -i ec1eeb60-5943-11c9-a309-08002b102989,1.1 -b ncacn_ip_tcp:16.20.15.25 -b ncadg_ip_udp:63.0.2.17 -o 30dbeea0-fb6c-11c9-8eea-08002b0f4528 -o 16977538-e257-11c9-8dc0-08002b0f4528 /.:/LandS/anthro/Cal_host_3 The following example shows the use of a user-defined environment variable as an interface identifier, to facilitate entering an export command interactively (in this case, from inside the control program). The initial two shell commands set up an environment variable Cal- endar_1_1, which represents the interface identifier of an RPC interface. The rpccp command then starts the control program, and the export command exports the Calendar interface and two string bindings to the server entry /.:/LandS/anthro/Cal_host_2 in the local cell, as follows: $ Calendar_1_1=ec1eeb60-5943-11c9-a309-08002b102989,1.1 $ export Calendar_1_1 $ rpccp rpccp> export -i Calendar_1_1 > -b ncacn_ip_tcp:16.20.15.25 > -b ncadg_ip_udp:63.0.2.17 > /.:/LandS/anthro/Cal_host_2 The following example shows the use of user-defined environment variables for object UUIDs to facilitate entering an export command inter- actively (in this case, from inside the control program). The initial shell commands set up the environment variables LUKE_CAL and JOSH_CAL, which represent personal calendars that are accessible as objects to an RPC server. The rpccp command then starts the control program, and the export command exports the two objects to the server's entry /.:/LandS/anthro/Cal_host_2 in the local cell: $ LUKE_CAL=30dbeea0-fb6c-11c9-8eea-08002b0f4528 $ export LUKE_CAL $ JOSH_CAL=16977538-e257-11c9-8dc0-08002b0f4528 $ export JOSH_CAL $ rpccp rpccp> export -o LUKE_CAL -o JOSH_CAL > /.:/LandS/anthro/Cal_host_2 RELATED INFORMATION
Commands: import(1m), show server(1m), unexport(1m) export(1m)
All times are GMT -4. The time now is 11:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy