Command files when the output is assigned to a variable
Hi,
i'm posting this in the Solaris forum although maybe it should be better in the General unix forum, I'm formatting an output witht he following command:
The output is fine, however when I issue the same command and assign the output to a variable:
I get the above error, can someone help with this?
Last edited by DukeNuke2; 01-14-2011 at 09:05 AM..
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)
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)
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)
I'm having a problem how to find the specific word in a file without using the word itself as a search but using the assigned variable which is the $passwd.. what command should I use to find the value of $passwd written in different script? how do I use the command to print the value in this... (7 Replies)
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)
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)
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)
Hi,
My command is getting stuck while running it.
observed that the grep command doesn't returned any data ($? was 1) and it failed.
This command is assigned into the variable and used in other command as script progresses. To continue the script output, i have to press ^C twice and script... (2 Replies)
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 LINUX
alcc
ALCC(1) aMule utilities ALCC(1)NAME
alcc - text based eD2k links calculator for aMule
SYNOPSIS
alcc [-p] [-v] <inputfiles_list>
alcc [-h]
DESCRIPTION
Compute the eD2k links of all the input files given in the <inputfiles_list> (There can be one or more files).
[ -p, --parthashes ]
Compute and add part hashes to the computed eD2k links.
[ -h, --help ]
Prints a short usage description.
[ -v, --verbose ]
Be verbose - show also calculation steps.
REPORTING BUGS
Please report bugs either on our forum (http://forum.amule.org/), or in our bugtracker (http://bugs.amule.org/). Please do not report bugs
in e-mail, neither to our mailing list nor directly to any team member.
COPYRIGHT
aMule and all of its related utilities are distributed under the GNU General Public License.
SEE ALSO alc(1), amuled(1), amulecmd(1), amuleweb(1), cas(1), ed2k(1), wxcas(1), xas(1)AUTHOR
This manpage was written by Vollstrecker <amule@vollstreckernet.de>
aMule eD2k links calculator November 2011 ALCC(1)