views:

30

answers:

2
cut -d" " -f2 ${2} | $callsTo

hello, can somebody please explain can I pipe the result of cut to variable callsTo, and how will it be stored, as the string or list?

A: 

It will call the command stored in $callsTo and send the standard output of cut to the standard input of said command as a string.

Ignacio Vazquez-Abrams
@Ignacio Vazquez-Abrams: how can store the result of cut in the variable callsTo?
lego69
If ${2} is not quoted it has to be a filename.
jim mcnamara
A: 

POSIX shell: - bash ksh

echo "${2}" | cut -d" " -f2  | read $callsTo 

or

callsTo=$(echo "${2}" | cut -d" " -f)

This assumes that the #2 parameter is a string with spaces in it.

I do not see how what is posted will work.

I misunderstood the orignal post. Completely - disregard this.

jim mcnamara