Sponsored Content
Top Forums Shell Programming and Scripting expr inside a ksh script Solaris Post 302270329 by Lakris on Sunday 21st of December 2008 05:25:26 AM
Old 12-21-2008
Hi,
well You don't have to have it on one line, do You? Whereever there is a ; just use ENTER instead to go to a new line.
And I don't think You need to export the variables. Instead of
dftotalsize=`expr $dftotalsize + $theinput`
You could use
dftotalsize=$((dftotalsize+theinput))

/Lakris
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

how do I get the value of expr with ksh

Hi, I have written a korn shell script to compute the value of k. formulae : a=10 b=20 c=30 k=(a+b)*c my shell script is : a=10 b=20 c=30 k=`expr (($a + $b ) * $c )` echo $k ### here paranthesis ( ) not accepting by expr function. (3 Replies)
Discussion started by: krishna
3 Replies

2. UNIX for Advanced & Expert Users

formatting textfile inside ksh script using awk not working

I cannot seem to get this text file to format. Its as if the awk statement is being treated as a simple cat command. I manned awk and it was very confusing. I viewed previous posts on this board and I got the same results as with the the awk command statement shown here. Please help. ... (6 Replies)
Discussion started by: tekline
6 Replies

3. Solaris

How to run a script as different user inside cronjob in solaris.

Hi , I have a shell script to perform some actions on sun solaris box . This script normally requires to be run as a different user. so, whenever i have to run this script, i need to sudo in as that user , enter the password and execute it. Now,I have to setup a cronjob to execute the script... (11 Replies)
Discussion started by: csg_user
11 Replies

4. Shell Programming and Scripting

ksh script using expr to calculate percentages

Within a ksh script on HP-UX I trying to calculate a percentage of a number (number/100 x percentage) using the below method and expr. TARPERC=`expr 16 / 100 \* 5` TARSUM=`expr 16 + $TARPERC` ZIPSUM=`expr $TARSUM \* 2` If the input is 16 outputs are: TARPERC: 0 TARSUM: 16 ZIPSUM: 32... (6 Replies)
Discussion started by: wurzul
6 Replies

5. Shell Programming and Scripting

expr error in ksh

Hi ALL, i am so much confused y the following script is not working in the korn shel which works in bash shell. please solve the error that i am facing. i want to extract the format of the size from a variable i.e. GB or KB or MB or B or BYTES code: -------- size_dir_pass=1.2gb... (2 Replies)
Discussion started by: G.K.K
2 Replies

6. Shell Programming and Scripting

Getting cntrl-c entered inside a ksh script

hi guys, my ksh script is calling another script. The other script expects user to press CNTR-C, and does not return to the prompt. in my script, I want to call the other script, but somehow don't want it to wait forever, I want to return to my script. e.g. script2.ksh outputs: "No... (2 Replies)
Discussion started by: JamesByars
2 Replies

7. Shell Programming and Scripting

How to call an sql script inside a while statement in KSH

Hi all, I'm trying to run an sql inside a loop which looks like this #!bin/ksh while IFS=, read var1 var2 do sqlplus -s ${USERNAME}/${PASSWORD}@${ORACLE_SID} << EOF insert into ${TABLE} ( appt_date ) values ( '${var1 }' ); ... (6 Replies)
Discussion started by: ryukishin_17
6 Replies

8. Shell Programming and Scripting

Issues with expr command on Solaris Box

Hello Friends, I have written a code on a Linux box, however, am getting issues while running it on a Solaris server. The issue with Sed command is sortd out, however, am still lokking for solutions with expr command. Here is the issue, Linux : bash-2.03$ expr match singh@test.com... (10 Replies)
Discussion started by: suffisandy
10 Replies

9. Shell Programming and Scripting

ksh script migration from Solaris to Linux.

We are migrating some scripts (ksh) from Solaris 10 to Linux 2.6.32. Can someone share list of changes i need to take care for this ? Have found few of them but i am looking for a exhaustive list. Thanks. (6 Replies)
Discussion started by: Shivdatta
6 Replies

10. Shell Programming and Scripting

sed command not working inside ksh script but works fine outside

Hi, I am a bit confused ,why would a sed command work fine outside of ksh script but not inside. e.g I want to replace all the characters which end with a value and have space at end of it. so my command for it is : sed -i "s/$SEPARATOR /$SEPARATOR/g" file_name This is working fine in... (8 Replies)
Discussion started by: vital_parsley
8 Replies
asadmin-export(1AS)						   User Commands					       asadmin-export(1AS)

NAME
asadmin-export, export - marks a variable name for automatic export to the environment of subsequent commands in multimode SYNOPSIS
export [ name=value [ name=value]*] Marks a variable name for automatic export to the environment of subsequent commands. All subsequent commands use the variable name values as specified; unless you unset them or exit multimode. If only the variable name is specified, the current value of that variable name is displayed. If the export command is used without any arguments, a list of all the exported variables and their values is displayed. Exported shell environment variables set prior to invoking the asadmin utility are imported automatically and set as exported variables within asadmin. Unexported environment variables cannot be read by the asadmin utility. OPERANDS
name=value variable name and value for automatic export to the environment to be used by subsequent commands. Example 1: Using export to list the environment variables asadmin> export AS_ADMIN_HOST=bluestar AS_ADMIN_PORT=8000 AS_ADMIN_USER=admin AS_ADMIN_PASSWORD=password asadmin> export AS_ADMIN_PREFIX=server1.jms-service asadmin> export //to list the environment variables that are set AS_ADMIN_HOST=bluestar AS_ADMIN_PORT=8000 AS_ADMIN_USER=admin AS_ADMIN_PASSWORD=******** AS_ADMIN_PREFIX=server1.jms-service Where: the export command lists the environment variables that are set. In this case, the environment variables have been set to: the host is bluestar, the port is 8000, the administrator user is admin with an associated password, and the prefix is server1.jms-service. EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin-unset(1AS), asadmin-multimode(1AS) J2EE 1.4 SDK March 2004 asadmin-export(1AS)
All times are GMT -4. The time now is 09:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy