Sponsored Content
Top Forums Shell Programming and Scripting Can I do this without eval? (zsh) Post 302990309 by MadeInGermany on Tuesday 24th of January 2017 01:03:39 PM
Old 01-24-2017
What do you mean? [ ] and test are functionally identical.
In my code example I have added quotes around the variables, for increased robustness.
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

tutorials about zsh

hi there I'm looking for tutorials about zsh (beginners to experts) can you give me addresses please? thx a lot (3 Replies)
Discussion started by: SpY974
3 Replies

2. UNIX for Dummies Questions & Answers

Z-shell (zsh)

Z-shell (zsh) anyone use it and how do ya like it? (1 Reply)
Discussion started by: Bodhi
1 Replies

3. UNIX for Dummies Questions & Answers

question about zsh

hi, In bash, $ bind -P | grep yank-last yank-last-arg can be found on "\M-.", "\M-_". this allows me to press ALT key and the period (.) to yank the last argument of the previous command line into the current command line. How can I get the same behavior in zsh ? Thanks ... (0 Replies)
Discussion started by: Andrewkl
0 Replies

4. Shell Programming and Scripting

Using zsh

Hi all i am forced to use tcsh at work but i want to use zsh, so i have added this to my .cshrc if (! $?STARTTCSH) then if ("$tty" != "" && -x /bin/zsh) exec /bin/zsh exit endif but this now stopped me going back to tcsh if i need to, is there a way to do this, i would... (7 Replies)
Discussion started by: ab52
7 Replies

5. Shell Programming and Scripting

Strange result of eval, how does eval really work with ssh?

Hi all, some small script with eval turned me to crazy. my OS is linux Linux s10-1310 2.6.16.53-0.8.PTF.434477.3.TDC.0-smp #1 SMP Fri Aug 31 06:07:27 PDT 2007 x86_64 x86_64 x86_64 GNU/Linux below script works well #!/bin/bash eval ssh remotehost date eval ssh remotehost ls below... (1 Reply)
Discussion started by: summer_cherry
1 Replies

6. Shell Programming and Scripting

Error in eval eval command to print html tags

anyone has any info on why this is complaining??? vivek@vivek-c5e55ef2e ~/TAC $ zoneCounter=1 vivek@vivek-c5e55ef2e ~/TAC $ optUsage1=23% vivek@vivek-c5e55ef2e ~/TAC $ eval eval echo "<th>Zone $zoneCounter </th><th align=\"left\"> \$optUsage$zoneCounter </th>" -bash: syntax error... (1 Reply)
Discussion started by: vivek d r
1 Replies

7. Shell Programming and Scripting

Error in eval eval command to print html tags

anyone has any info on why this is complaining??? vivek@vivek-c5e55ef2e ~/TAC $ zoneCounter=1 vivek@vivek-c5e55ef2e ~/TAC $ optUsage1=23% vivek@vivek-c5e55ef2e ~/TAC $ eval eval echo "<th>Zone $zoneCounter </th><th align=\"left\"> \$optUsage$zoneCounter </th>" -bash: syntax error... (13 Replies)
Discussion started by: vivek d r
13 Replies

8. Shell Programming and Scripting

Zsh array -a vs. -A question

Inside a zsh function, I create a local array with local -a arrayname and a local associative array with local -A arrayname. I also can create an array using set, like this: set -A arrayname value1 value2 value3In this form, I can not explicitly declare that an array is associative or... (2 Replies)
Discussion started by: rovf
2 Replies
Test::Identity(3pm)					User Contributed Perl Documentation				       Test::Identity(3pm)

NAME
"Test::Identity" - assert the referential identity of a reference SYNOPSIS
use Test::More tests => 2; use Test::Identity; use Thingy; { my $thingy; sub get_thingy { return $thingy } sub set_thingy { $thingy = shift; } } identical( get_thingy, undef, 'get_thingy is undef' ); my $test_thingy = Thingy->new; set_thingy $test_thingy; identical( get_thingy, $thingy, 'get_thingy is now $test_thingy' ); DESCRIPTION
This module provides a single testing function, "identical". It asserts that a given reference is as expected; that is, it either refers to the same object or is "undef". It is similar to "Test::More::is" except that it uses "refaddr", ensuring that it behaves correctly even if the references under test are objects that overload stringification or numification. It also provides better diagnostics if the test fails: $ perl -MTest::More=tests,1 -MTest::Identity -e'identical [], {}' 1..1 not ok 1 # Failed test at -e line 1. # Expected an anonymous HASH ref, got an anonymous ARRAY ref # Looks like you failed 1 test of 1. $ perl -MTest::More=tests,1 -MTest::Identity -e'identical [], []' 1..1 not ok 1 # Failed test at -e line 1. # Expected an anonymous ARRAY ref to the correct object # Looks like you failed 1 test of 1. FUNCTIONS
identical( $got, $expected, $name ) Asserts that $got refers to the same object as $expected. AUTHOR
Paul Evans <leonerd@leonerd.org.uk> perl v5.10.1 2010-11-28 Test::Identity(3pm)
All times are GMT -4. The time now is 02:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy