Sponsored Content
Top Forums Shell Programming and Scripting Echo not displaying variable in If-Else condition Post 302771909 by RudiC on Friday 22nd of February 2013 05:42:58 AM
Old 02-22-2013
What's the value of x_oug? How do you assign it? Did you run the script with the xtrace option set?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Display from a variable using echo.

I have a variable that is outputting a lot of space. here has been 45 lines returned ... how can I remove the spaces between the "been and the 45" CODE: fil_len=`wc -l < coshb.txt` if ; then cat coshb.txt | more echo " " echo "There has been ${fil_len} lines... (4 Replies)
Discussion started by: jagannatha
4 Replies

2. Shell Programming and Scripting

echo variable problem

hi I have say five variable. I would ask the user which one they want me to print and then print accordingly. TEST_1='10.2.3.4' TEST_2='11.2.3.5' TEST_3='12.2.3.5' TEST_4='13.2.3.5' TEST_5='14.2.3.5' print_var() { echo "Accessing var num $1" echo TEST$1 #??? But How do... (6 Replies)
Discussion started by: sabina
6 Replies

3. Shell Programming and Scripting

assigning variable value using echo

I am modifying an existing script and it has the following line: export SomeEnvVar=`echo ${SomeLocalVar}` Why wouldn't it just read: export SomeEnvVar=${SomeLocalVar} Is there some reason to use echo instead of a direct assignment? :confused: (2 Replies)
Discussion started by: shellburger
2 Replies

4. Shell Programming and Scripting

multiple echo statements in if condition

Hi , I have a peculiar problem. i have an if block like this if ; then echo " todays date is " ${date} >> log_file echo " file count is " $ count >> log_file mv filename1 filename 2 else echo "no files available ">> log_file fi the echo statement "no files available " is not... (2 Replies)
Discussion started by: wizardofoz
2 Replies

5. Shell Programming and Scripting

read variable after echo

Hi, i want to create an user-friendly script where you are asked for two numbers. i would like that these two number to be separated with "--" for example, but i can't figure out how to do this. for example read -p "Insert lowest and highest value: " min ; echo -n "-- "; read max so... (3 Replies)
Discussion started by: ezitoc
3 Replies

6. Shell Programming and Scripting

Variable not displaying while running in cron job

hi , While running my script individually the variable is working fine. But when i am running the same script from cron job it's displaying nothing. Can any one comment on this. (4 Replies)
Discussion started by: josephroyal
4 Replies

7. Shell Programming and Scripting

redirect stdout echo command in condition A run in condition B

hi, I have some problems in my simple script about the redirect echo stdout command inside a condition. Why is the echo command inside the elif still execute in the else command Here are my simple script After check on the two diff output the echo stdout redirect is present in two diff... (3 Replies)
Discussion started by: jao_madn
3 Replies

8. Shell Programming and Scripting

echo the NAME of the variable

#!/bin/bash varA="AAA1" varB="BBB2" varC="CCC3" for proccx in $varA $varB $varC do echo "the current name is ????? , the value is $proccx" echo " " done #end of script I want the output to look something like this: the current name is varA, the value is AAA1 the current name is... (5 Replies)
Discussion started by: ajp7701
5 Replies

9. UNIX for Dummies Questions & Answers

Displaying contents with Echo

Hello, How can i display the below ... say echo "Start \n Analyse \n ~/temp/input.txt \nStop" Now my output should look like below Start Analyse This is from input file Stop I tried echo "Start \n Analyse \n $var \nStop where $var = "~/temp/input.txt".. It did not work out..... (3 Replies)
Discussion started by: sathyaonnuix
3 Replies

10. UNIX for Beginners Questions & Answers

Variable not displaying in subject line of mailx email

Hi Newbie here with first post. I've got a shell script (ksh) whereby I run a SQL*Plus script and output the results to a file. I then check the output file in an if statement that looks like this: if ]; then export GAPNUM=`awk '{print $4}' $OUTFILE` if ] then mailx -s... (10 Replies)
Discussion started by: ltzwoman
10 Replies
doconfig(3NSL)                                         Networking Services Library Functions                                        doconfig(3NSL)

NAME
doconfig - execute a configuration script SYNOPSIS
cc [ flag ... ] file ... -lnsl [ library ... ] # include <sac.h> int doconfig(int fildes, char *script, long rflag); DESCRIPTION
doconfig() is a Service Access Facility library function that interprets the configuration scripts contained in the files </etc/saf/pmtag/_config>, </etc/saf/_sysconfig>, and </etc/saf/pmtag/svctag>, where pmtag specifies the tag associated with the port moni- tor, and svctag specifies the service tag associated with a given service. See pmadm(1M) and sacadm(1M). script is the name of the configuration script; fildes is a file descriptor that designates the stream to which stream manipulation opera- tions are to be applied; rflag is a bitmask that indicates the mode in which script is to be interpreted. If rflag is zero, all commands in the configuration script are eligible to be interpreted. If rflag has the NOASSIGN bit set, the assign command is considered illegal and will generate an error return. If rflag has the NORUN bit set, the run and runwait commands are considered illegal and will generate error returns. The configuration language in which script is written consists of a sequence of commands, each of which is interpreted separately. The fol- lowing reserved keywords are defined: assign, push, pop, runwait, and run. The comment character is #; when a # occurs on a line, every- thing from that point to the end of the line is ignored. Blank lines are not significant. No line in a command script may exceed 1024 char- acters. assign variable=value Used to define environment variables. variable is the name of the environment variable and value is the value to be assigned to it. The value assigned must be a string constant; no form of parameter substitution is available. value may be quoted. The quoting rules are those used by the shell for defining environment variables. assign will fail if space cannot be allocated for the new variable or if any part of the specification is invalid. push module1[, module2, module3, . . .] Used to push STREAMS modules onto the stream designated by fildes. module1 is the name of the first module to be pushed, module2 is the name of the second module to be pushed, etc. The command will fail if any of the named modules cannot be pushed. If a module cannot be pushed, the subsequent modules on the same command line will be ignored and modules that have already been pushed will be popped. pop [module] Used to pop STREAMS modules off the designated stream. If pop is invoked with no arguments, the top module on the stream is popped. If an argument is given, modules will be popped one at a time until the named module is at the top of the stream. If the named module is not on the designated stream, the stream is left as it was and the command fails. If module is the special keyword ALL, then all mod- ules on the stream will be popped. Note that only modules above the topmost driver are affected. runwait command The runwait command runs a command and waits for it to complete. command is the pathname of the command to be run. The command is run with /usr/bin/sh -c prepended to it; shell scripts may thus be executed from configuration scripts. The runwait command will fail if command cannot be found or cannot be executed, or if command exits with a non-zero status. run command The run command is identical to runwait except that it does not wait for command to complete. command is the pathname of the command to be run. run will not fail unless it is unable to create a child process to execute the command. Although they are syntactically indistinguishable, some of the commands available to run and runwait are interpreter built-in commands. Interpreter built-ins are used when it is necessary to alter the state of a process within the context of that process. The doconfig() interpreter built-in commands are similar to the shell special commands and, like these, they do not spawn another process for execution. See sh(1). The built-in commands are: cd ulimit umask RETURN VALUES
doconfig() returns 0 if the script was interpreted successfully. If a command in the script fails, the interpretation of the script ceases at that point and a positive number is returned; this number indicates which line in the script failed. If a system error occurs, a value of -1 is returned. When a script fails, the process whose environment was being established should not be started. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
sh(1), pmadm(1M), sacadm(1M), attributes(5) NOTES
This interface is unsafe in multithreaded applications. Unsafe interfaces should be called only from the main thread. SunOS 5.10 30 Dec 1996 doconfig(3NSL)
All times are GMT -4. The time now is 04:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy