Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-23-2004, 01:22 AM   #1
Registered: Jan 2004
Location: On Planet Earth.
Distribution: Slackware 12
Posts: 244

Rep: Reputation: 30
Help with command line arguments ?

Hi all

Heres my latest question Ive been trying and reading but i cant seem to get this right.

I have a separate file with a number of lines of text in it , say a word for each line,
how can i get this file to be redirected and read into a command as command line arguments to the actual command that i am using?

Old 02-23-2004, 02:43 AM   #2
Registered: Sep 2003
Location: Paris, France
Distribution: Arch x86_64
Posts: 221

Rep: Reputation: 30
maybe something like this :
while read one_line; do
	yourcommand $one_line
done < name_of_your_textfile
Old 02-23-2004, 03:25 AM   #3
Senior Member
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
you could do this:
cat filename | xargs command


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
alsamixer command line arguments dereko Debian 3 09-29-2008 03:06 PM
Awk command-line arguments lowpro2k3 Programming 1 03-28-2005 10:09 PM
number of command line arguments to shell u4u Linux - General 1 03-04-2005 07:09 PM
Streaming in values without defined command line arguments liguorir Linux - Software 1 05-07-2004 03:40 AM
Command line arguments to java program Majjj Programming 3 10-23-2003 06:48 AM > Forums > Linux Forums > Linux - Newbie

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

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