LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-22-2008, 03:35 AM   #1
warmight
LQ Newbie
 
Registered: Sep 2005
Posts: 4

Rep: Reputation: 0
Simple Qns: How to read and output arguements


Dear all,

How to do a script to do the following?
CommandA <fileA.txt> <fileA.XXX>

Take in the first arguement - e.g. fileA.txt and output to second arguement - e.g. fileA.XXX
Where the 2nd arguement must be the same filename of the first except only the extension which is different?

Many Thanks in advance.

regards,
 
Old 05-22-2008, 05:40 AM   #2
clvic
Member
 
Registered: Feb 2008
Location: Rome, Italy
Distribution: OpenSuSE 11.x, vectorlinux, slax, Sabayon
Posts: 206
Blog Entries: 2

Rep: Reputation: 45
Here what I would do, knowing that the first file extension is .txt and that I want the second extension to be .XXX:
CommandA fileA.txt `basename fileA.txt .txt`.XXX
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide program arguements from ps? jon_k Programming 3 10-29-2006 12:52 AM
simple input output java 1.4 titanium_geek Programming 4 05-07-2006 06:33 AM
alias command line arguements Henster Linux - Newbie 2 07-01-2005 03:40 AM
alternative printf ... multible arguements jnusa Programming 4 12-14-2004 06:22 AM
maybe NOT so simple an output query dougp Linux - General 1 09-05-2002 08:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:16 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