Ejemplo n.º 1
0
def cmd_main(args):
    for record in split.iter_stream(sys.stdin):
        fields = split.field_split(record)

        processArgs = [env.SHELL, '-c', args.command]

        p = subprocess.Popen(
            processArgs, env={args.variable: record}, stdout=subprocess.PIPE)

        for line in p.stdout.readlines():
            print(line)
Ejemplo n.º 2
0
def cmd_main(args):
    for record in split.iter_stream(sys.stdin):
        fields = split.field_split(record)

        processArgs = [env.SHELL, '-c', args.command]

        p = subprocess.Popen(processArgs,
                             env={args.variable: record},
                             stdout=subprocess.PIPE)

        for line in p.stdout.readlines():
            print(line)
Ejemplo n.º 3
0
def cmd_main(args):
    for record in split.iter_stream(sys.stdin):
        fields = split.field_split(record)

        processArgs = [env.SHELL, '-c', args.command]

        varPack = dict([(args.variable, record)])

        for index, val in enumerate(fields):
            varPack[args.variable + str(index)] = val

        p = subprocess.Popen(processArgs, env=varPack)

        if p.returncode == 0:
            print(record)
        else:
            continue
Ejemplo n.º 4
0
def cmd_main(args):
    for record in split.iter_stream(sys.stdin):
        fields = split.field_split(record)

        processArgs = [env.SHELL, '-c', args.command]

        varPack = dict([(args.variable, record)])

        for index, val in enumerate(fields):
            varPack[args.variable+str(index)] = val

        p = subprocess.Popen(processArgs, env=varPack)

        if p.returncode == 0:
            print(record)
        else:
            continue
Ejemplo n.º 5
0
def cmd_main(args):
    for record in split.iter_stream(sys.stdin):
        fields = split.field_split(record)

        print(env.OFS.join(fields), end=env.ORS)