LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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-2009, 10:31 AM   #1
matt123
LQ Newbie
 
Registered: Apr 2009
Posts: 11

Rep: Reputation: 0
Shell command that could combine aXpXe and XpXlX to say apple


Anyone know of a shell command that could combine aXpXe and XpXlX to say apple. It would be replacing the X's with the corresponding char from the other word. Thanks!
 
Old 09-29-2009, 12:24 PM   #2
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
i smell homework!
not with a single shell command, i dont think
 
Old 09-30-2009, 05:22 AM   #3
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
I think there's a way. Play around with ${parameter:n:m} in bash.. Do 'man bash' for more info.
 
Old 09-30-2009, 05:35 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by smeezekitty View Post
i smell homework!
not with a single shell command, i dont think
And what exactly does homework smell like??... Seriously, the posting history says not homework, but..

matt;
Please tell us the context--why you need to do this--also, are you getting the two words from user input? from a file?
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find command and rsync combine b-RAM Linux - General 21 05-29-2009 02:37 AM
Get no colors on terminal using ssh to connect to apple machine(bash shell) skvikas Linux - General 4 10-24-2008 02:10 PM
Combine files using shell scripting ccray Linux - Newbie 14 01-12-2006 11:14 AM
How to combine Expect and Shell script Uday123 Programming 0 12-27-2005 09:01 AM
Command to combine several files as a single file, etc. satimis *BSD 3 06-10-2004 03:59 AM

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

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