Esempio 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)
Esempio 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)
Esempio 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
Esempio 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
Esempio 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)