LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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
 
LinkBack Search this Thread
Old 09-21-2006, 10:27 PM   #1
johnsanty
Member
 
Registered: Apr 2006
Posts: 49

Rep: Reputation: 15
What is a command wrapper?


Hi All,

I came across with the term "command wrapper". What does it really mean? I've been searching the web but I still don't have a clear picture of what this term really is. Could somebody clarify me on this one...Thanks for you prompt reply..


John.
 
Old 09-22-2006, 12:40 AM   #2
zhangmaike
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 376

Rep: Reputation: 31
In general, a wrapper extends or makes it easier to use the command that it is "wrapping" without reimplementing that command's functionality - it simply calls the original command. These are usually scripts.
 
Old 09-22-2006, 01:35 AM   #3
primo
Member
 
Registered: Jun 2005
Posts: 542

Rep: Reputation: 34
In the context of system's programming, a command wrapper may be a program that makes available a particular call to the user. Examples may be readlink(1), realpath(1), truncate(1), etc.
 
Old 09-22-2006, 06:39 AM   #4
johnsanty
Member
 
Registered: Apr 2006
Posts: 49

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by zhangmaike
In general, a wrapper extends or makes it easier to use the command that it is "wrapping" without reimplementing that command's functionality - it simply calls the original command. These are usually scripts.

So basically, it's a script which contains a specific command? So, for example if I want to wrap a command "ls", all I need to do is write a script and put the command "ls" in this script? Is that correct? If not, could you give me an example? Thanks for your prompt reply...

John
 
Old 09-22-2006, 07:15 AM   #5
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,141

Rep: Reputation: 329Reputation: 329Reputation: 329Reputation: 329
A simple example is the KDE windowing environment where many commands are embeded in the system and executed as needed to display various windows on your screen.
 
Old 09-22-2006, 02:19 PM   #6
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
Quote:
Originally Posted by johnsanty
So basically, it's a script which contains a specific command? So, for example if I want to wrap a command "ls", all I need to do is write a script and put the command "ls" in this script? Is that correct? If not, could you give me an example? Thanks for your prompt reply...

John
yeh pretty much. usually when you wrap something you usually do it because you want to change the behavior of the command, but still need the same base functionality. so with ls example, if you want to print out the current directoy that you are listing then it would be something like
Code:
#!/bin/bash
echo "listing contents of " `pwd`
ls
put that in an executable file named lspwd and you have just wrapped ls command

also in a more programming sense a wrapper is used to change an interface in some way.. but it sounds like you are looking for something like the above right..

Last edited by xhi; 09-22-2006 at 02:20 PM.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
application wrapper dmonty Linux - Software 4 10-23-2005 03:13 PM
NDIS Wrapper Help Please FuGeE Linux - Wireless Networking 1 12-11-2004 11:14 AM
OS Wrapper ines Linux - Software 10 11-04-2004 06:57 AM
FTP wrapper dominant Linux - Security 9 03-25-2004 03:34 AM
ndis wrapper citrus Linux - Hardware 3 01-08-2004 06:10 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration