11-30-2012
I have no idea what you are even trying to do there. You read the variable, then immediately overwrite it with something else without using it for anything. What is the intent?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
If i write this statement in a Korn Shell script
RCODE=$?
what possibly does it eman? (3 Replies)
Discussion started by: ranjita.c
3 Replies
2. Shell Programming and Scripting
How do I evaluate the result of a command assigned to a variable??
Example:
var1=`cmd`
rc=$?
rc will be the result of the assignment rather than cmd since it executes after. How do I evaluate the result of the command itself?
Cheers..:confused: (2 Replies)
Discussion started by: browndr
2 Replies
3. Shell Programming and Scripting
Hi,
I want to check if a variable has a value assigned to it or not.
I can do following -
cat $Var > File1
if
then
echo "$Var has value"
else
echo "$Var is null"
fi
But I have to check for 3 Variables and I want to wrap it up in couple of unix statements.
Any... (3 Replies)
Discussion started by: sumeet
3 Replies
4. Shell Programming and Scripting
Hey ,
I'm trying to perform the following command, however it cannot read the variable assigned earlier. I'm not sure why this happen. Please help thanks
while :
do
echo "what's ur name? (if none just press )"
read name
changeName = echo $name | sed "s/on/ey/"
echo $changeName #this... (8 Replies)
Discussion started by: sexyTrojan
8 Replies
5. Shell Programming and Scripting
I am making of a script that will go through a couple of for loops and create file names based on the values in that loop, however the variable that combines everything is not getting assigned properly:
#! /bin/bash
for imod in K33_j1b_WS9_6
do
for emod in mb2A mb2C mb3A mb3C mb4A... (1 Reply)
Discussion started by: badinsults
1 Replies
6. Shell Programming and Scripting
The requirement is, there is a log file which contains a huge data. i need to get a particular field out of it by searching with another field.
ex:
2011-03-28 13:00:07,423 : millis=231 q={ call get_data_account(?,?,?,?,?) }, params=
i need to search for the word "get_data_account" in file... (1 Reply)
Discussion started by: Jassz
1 Replies
7. UNIX for Dummies Questions & Answers
I am trying to check whether a variable has been assigned on the command line or not.
Here is what I did:
#!/usr/bin/bash
if( $variable == '\0')
{
print "variable was not assigned"
exit
}
else
NF = 2 {print $1, ""}
exit
fi
awk -f question1.awk variable = 58 letters.txt.
So... (3 Replies)
Discussion started by: Fred63528
3 Replies
8. UNIX for Dummies Questions & Answers
Hi there can anyone help me
here is my code
echo "Type in a positive number"
read X
I=2
while
do
if
then
echo "It is not prime"
break
else
if
then
echo "It is prime"
break
else
I=$(( $I + 1))
fi
fi (4 Replies)
Discussion started by: FUTURE_EINSTEIN
4 Replies
9. Shell Programming and Scripting
I want to do 2 things in single line that is evaluating a command to get return code and store $2 of awk if the command exit code is 0.
eval "ade desc ${filename}@@/<branch_name> | grep Version | awk '{print $2}' 2>&1 1>/dev/null"
ret=$?
echo "$ret $val"
if
then
... (3 Replies)
Discussion started by: ezee
3 Replies
10. Shell Programming and Scripting
Experts,
I'm having problems with the code below.
I'm trying to test $var2 for two different regexs.
I thought it could be done per below, but I'm getting the following error when running.
$ ./test.pl b fed50c0100****
Unescaped left brace in regex is deprecated, passed through in regex; marked... (2 Replies)
Discussion started by: timj123
2 Replies
LEARN ABOUT DEBIAN
explain_setenv_or_die
explain_setenv_or_die(3) Library Functions Manual explain_setenv_or_die(3)
NAME
explain_setenv_or_die - change or add an environment variable and report errors
SYNOPSIS
#include <libexplain/setenv.h>
void explain_setenv_or_die(const char *name, const char *value, int overwrite);
int explain_setenv_on_error(const char *name, const char *value, int overwrite);
DESCRIPTION
The explain_setenv_or_die function is used to call the setenv(3) system call. On failure an explanation will be printed to stderr, obtained
from the explain_setenv(3) function, and then the process terminates by calling exit(EXIT_FAILURE).
The explain_setenv_on_error function is used to call the setenv(3) system call. On failure an explanation will be printed to stderr,
obtained from the explain_setenv(3) function, but still returns to the caller.
name The name, exactly as to be passed to the setenv(3) system call.
value The value, exactly as to be passed to the setenv(3) system call.
overwrite
The overwrite, exactly as to be passed to the setenv(3) system call.
RETURN VALUE
The explain_setenv_or_die function only returns on success, see setenv(3) for more information. On failure, prints an explanation and
exits, it does not return.
The explain_setenv_on_error function always returns the value return by the wrapped setenv(3) system call.
EXAMPLE
The explain_setenv_or_die function is intended to be used in a fashion similar to the following example:
explain_setenv_or_die(name, value, overwrite);
SEE ALSO
setenv(3)
change or add an environment variable
explain_setenv(3)
explain setenv(3) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2010 Peter Miller
explain_setenv_or_die(3)