Uname: Linux webm016.cluster127.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Software: Apache
PHP version: 7.4.33 [ PHP INFO ] PHP os: Linux
Server Ip: 54.36.31.145
Your Ip: 216.73.216.182
User: homesquasz (91404) | Group: users (100)
Safe Mode: OFF
Disable Function:
_dyuweyrj4,_dyuweyrj4r,dl

name : env.js
var test = require('tape');
var parse = require('../').parse;

test('expand environment variables', function (t) {
    t.same(parse('a $XYZ c', { XYZ: 'b' }), [ 'a', 'b', 'c' ]);
    t.same(parse('a${XYZ}c', { XYZ: 'b' }), [ 'abc' ]);
    t.same(parse('a${XYZ}c $XYZ', { XYZ: 'b' }), [ 'abc', 'b' ]);
    t.same(parse('"-$X-$Y-"', { X: 'a', Y: 'b' }), [ '-a-b-' ]);
    t.same(parse("'-$X-$Y-'", { X: 'a', Y: 'b' }), [ '-$X-$Y-' ]);
    t.same(parse('qrs"$zzz"wxy', { zzz: 'tuv' }), [ 'qrstuvwxy' ]);
    t.same(parse("qrs'$zzz'wxy", { zzz: 'tuv' }), [ 'qrs$zzzwxy' ]);
    t.same(parse("qrs${zzz}wxy"), [ 'qrswxy' ]);
    t.same(parse("qrs$wxy $"), [ 'qrs', '$' ]);
    t.same(parse('grep "xy$"'), [ 'grep', 'xy$' ]);
    t.same(parse("ab$x", { x: 'c' }), [ 'abc' ]);
    t.same(parse("ab\\$x", { x: 'c' }), [ 'ab$x' ]);
    t.same(parse("ab${x}def", { x: 'c' }), [ 'abcdef' ]);
    t.same(parse("ab\\${x}def", { x: 'c' }), [ 'ab${x}def' ]);
    t.same(parse('"ab\\${x}def"', { x: 'c' }), [ 'ab${x}def' ]);
    
    t.end();
});

test('environment variables with metacharacters', function (t) {
    t.same(parse('a $XYZ c', { XYZ: '"b"' }), [ 'a', '"b"', 'c' ]);
    t.same(parse('a $XYZ c', { XYZ: '$X', X: 5 }), [ 'a', '$X', 'c' ]);
    t.same(parse('a"$XYZ"c', { XYZ: "'xyz'" }), [ "a'xyz'c" ]);
    
    t.end();
});

test('special shell parameters', function (t) {
    var chars = '*@#?-$!0_'.split('');
    t.plan(chars.length);
    
    chars.forEach(function (c) {
        var env = {};
        env[c] = 'xxx';
        t.same(parse('a $' + c + ' c', env), [ 'a', 'xxx', 'c' ]);
    });
});
© 2026 GrazzMean
Page non trouvée – APK Comptoir Hammami
Jannah Theme License is not validated, Go to the theme options page to validate the license, You need a single license for each domain name.

404 :(

Oups ! Cette page est introuvable.

Il semble que nous ne puissions pas trouver ce que vous cherchez. Peut-être qu'une recherche pourrait vous aider.

Bouton retour en haut de la page