Experts,
I'm having problems with the code below.
I'm trying to test
for two different regexs.
I thought it could be done per below, but I'm getting the following error when running.
Does anyone have any ideas what I'm doing wrong here?
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)
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)
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)
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:
crontab -l | grep GBOUAT8 | grep UTP | grep -i stop | sed 's/\\//'
08 2 * * 2-6 /apps/sum_glob/gbo_uat/sparse/bin/dmg_cronlaunch -ENVI... (2 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 am more of a newbie, but wanted to post this in this forum as I was afraid no one would look at it in unix forums as it concerns shell scripting. I have a shell script that now runs fine with the exclusion of one line:
x=`su nbadmin -c "ssh -t servery /usr/openv/netbackup/bin/bplist -C... (7 Replies)
Discussion started by: newbie2010
7 Replies
LEARN ABOUT DEBIAN
prophet::test
Prophet::Test(3pm) User Contributed Perl Documentation Prophet::Test(3pm)
set_editor($code)
Sets the subroutine that Prophet should use instead of "Prophet::CLI::Command::edit_text" (as this routine invokes an interactive editor)
to $code.
set_editor_script SCRIPT
Sets the editor that Proc::InvokeEditor uses.
This should be a non-interactive script found in t/scripts.
import_extra($class, $args)
in_gladiator($code)
Run the given code using Devel::Gladiator.
repo_path_for($username)
Returns a path on disk for where $username's replica is stored.
repo_uri_for($username)
Returns a file:// URI for $USERNAME'S replica (with the correct replica type prefix).
replica_uuid
Returns the UUID of the test replica.
database_uuid
Returns the UUID of the test database.
replica_last_rev
Returns the sequence number of the last change in the test replica.
as_user($username, $coderef)
Run this code block as $username. This routine sets up the %ENV hash so that when we go looking for a repository, we get the user's repo.
replica_uuid_for($username)
Returns the UUID of the given user's test replica.
database_uuid_for($username)
Returns the UUID of the given user's test database.
ok_added_revisions( { CODE }, $numbers_of_new_revisions, $msg)
Checks that the given code block adds the given number of changes to the test replica. $msg is optional and will be printed with the test
if given.
serialize_conflict($conflict_obj)
Returns a simple, serialized version of a Prophet::Conflict object suitable for comparison in tests.
The serialized version is a hash reference containing the following keys:
meta => { original_source_uuid => 'source_replica_uuid' }
records => { 'record_uuid' =>
{ change_type => 'type',
props => { propchange_name => { source_old => 'old_val',
source_new => 'new_val',
target_old => 'target_val',
}
}
},
'another_record_uuid' =>
{ change_type => 'type',
props => { propchange_name => { source_old => 'old_val',
source_new => 'new_val',
target_old => 'target_val',
}
}
},
}
serialize_changeset($changeset_obj)
Returns a simple, serialized version of a Prophet::ChangeSet object suitable for comparison in tests (a hash).
run_command($command, @args)
Run the given command with (optionally) the given args using a new Prophet::CLI object. Returns the standard output of that command in
scalar form or, in array context, the STDOUT in scalar form *and* the STDERR in scalar form.
Examples:
run_command('create', '--type=Foo');
load_record($type, $uuid)
Loads and returns a record object for the record with the given type and uuid.
as_alice CODE, as_bob CODE, as_charlie CODE, as_david CODE
Runs CODE as alice, bob, charlie or david.
perl v5.10.1 2009-09-02 Prophet::Test(3pm)