unix eval tool

hoppa

Senior member
Apr 10, 2004
253
0
0
I've got a program that prints out a bunch of commands that I want to then be evaluated but I don't know the correct command for the job. Basically I want

perl blah.pl | eval

or something similar. Does such a thing exist?

-andy
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
You probalby need eval `perl blah.pl` since I don't think eval accepts commands on stdin.
 

DaiShan

Diamond Member
Jul 5, 2001
9,617
1
0
Originally posted by: Nothinman
You probalby need eval `perl blah.pl` since I don't think eval accepts commands on stdin.

If that doesn't work, you can redirect the output of your perl script to a file then write a quick bash script to loop through the info.

perl blah.pl > /home/daishan/file

#!/bin/bash

for command in `cat /home/daishan/file`;

do

eval $command

done