LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-29-2003, 02:02 PM   #1
daeojkim
LQ Newbie
 
Registered: Sep 2003
Posts: 5

Rep: Reputation: 0
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.
 
Old 09-29-2003, 02:13 PM   #2
iceman47
Senior Member
 
Registered: Oct 2002
Location: Belgium
Distribution: Debian, Free/OpenBSD
Posts: 1,123

Rep: Reputation: 47
% 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.
 
Old 09-29-2003, 02:16 PM   #3
daeojkim
LQ Newbie
 
Registered: Sep 2003
Posts: 5

Original Poster
Rep: Reputation: 0
Hey that worked!!!

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

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

Thanks for the help!!!
 
Old 09-30-2003, 11:21 PM   #4
lenlutz
Member
 
Registered: May 2003
Location: philadelhpia pa
Posts: 92

Rep: Reputation: 15
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to use command line with Linux ywergs Fedora 7 10-01-2005 10:56 PM
Simple / quick GUI on the command line ? michael_util Programming 3 01-05-2005 06:08 PM
Command Line On Linux??? unwrittenlaw Linux - Newbie 7 11-25-2003 01:59 AM
booting linux in simple command line tombomb300 Linux - Newbie 1 10-18-2003 02:49 PM
Command Line Linux Fusion07 Linux - Newbie 6 07-03-2002 01:47 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration