LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Simple help in Linux command line (https://www.linuxquestions.org/questions/programming-9/simple-help-in-linux-command-line-98288/)

daeojkim 09-29-2003 01:02 PM

Simple help in Linux command line
 
Hello.
I have a simple question. I would like to pipe a command to a program called gh from the linux prompt.

If I make a text file and write the content of commands for program gh then I cat it and pipe to the program it works. i.e.

% cat <txtfile.txt> | gh

This works.

But I would like to do this without having to make the txtfile.txt with command line for gh.

I tried something like

% "load chromosome.txt" | gh

in this case "load chromosome.txt" would be a command like for gh. This method did not work.

Is there anyway to do this?

Thanks in advance.

iceman47 09-29-2003 01:13 PM

% echo "load chromosome.txt" | gh

this pipes the string load chromosome.txt to gh.
Not sure if it'll work though, depends on the program.

daeojkim 09-29-2003 01:16 PM

Hey that worked!!!

You are the man!!! or iceman .. (:scratch: )

Working in biomed research I am not much of a comp wiz.. ;)

Thanks for the help!!!

lenlutz 09-30-2003 10:21 PM

If i understand your question:
pipe, just redirects stdin....
the commands are read in as arguments, PROIR to stdin, reading the pipe.....

you might try
COMAND_STR=" -a -b -c -ffilename"
gh $COMAND_STR

I just tried
X="-la /tmp"
ls $X
and it worked

(ksh, sh, bash).... homey dont do c shell


All times are GMT -5. The time now is 04:20 PM.