LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 10-15-2009, 03:39 AM   #1
Moody1
LQ Newbie
 
Registered: Oct 2009
Posts: 3

Rep: Reputation: 0
Unhappy Shell Programming, newbie


Hello,
i'm completely new to linux and shell programing
i'm using linux fedora v.8, bash
i want to know how to print argument value depending on other argumet value.
ex. i have two txt files
the first one includes 2 arguments $1, $2 (these values r entered through program)
the second one includes 2 arguments $3, $2 (these values r entered through program)
now through shell program the user will enter $3 value, so i want through this value to print $1 value, any help?


- then i want to know how to consider each word that entered by user as an argument and how to print the third word (as an ex.)
ex. the user will enter this line;
test test1 test2 test3 test4 ....
so how to print the third word?

i hope that my questions are clear

thanks in advance
 
Old 10-15-2009, 04:22 AM   #2
Lordandmaker
Member
 
Registered: Sep 2005
Location: London, UK
Distribution: Debian
Posts: 258

Rep: Reputation: 39
I'm having a little trouble working out exactly what you're asking. Can you post some sample code, so we can see what you've tried and get more of a feel for exactly what you want?
 
Old 10-15-2009, 05:52 AM   #3
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
Its a double post.
 
  


Reply



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



LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:32 PM.

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