UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 13th, 2006, 06:32 PM
jaffy jaffy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2006
Posts: 3 jaffy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 2 m 2 sec
Reputation Power: 0
Wrapping an executable

I need to ensure that when a certain executable is used particular flag are passed to it, including any flags the user tries.

So I was thinking of using a shellscript of the same name as the executable which calls the real executable plus all flags.

I do not wish to use an alias for this task for a million reasons, so does anyone have a better idea than my hacky solution?

thanks

Reply With Quote
  #2  
Old September 13th, 2006, 08:58 PM
vlsimpson vlsimpson is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2005
Location: The grassy knoll
Posts: 115 vlsimpson User rank is Sergeant Major (2000 - 5000 Reputation Level)vlsimpson User rank is Sergeant Major (2000 - 5000 Reputation Level)vlsimpson User rank is Sergeant Major (2000 - 5000 Reputation Level)vlsimpson User rank is Sergeant Major (2000 - 5000 Reputation Level)vlsimpson User rank is Sergeant Major (2000 - 5000 Reputation Level)vlsimpson User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 5 Days 1 h 59 m 2 sec
Reputation Power: 41
Quote:
Originally Posted by jaffy
I need to ensure that when a certain executable is used particular flag are passed to it, including any flags the user tries.

So I was thinking of using a shellscript of the same name as the executable which calls the real executable plus all flags.

I do not wish to use an alias for this task for a million reasons, so does anyone have a better idea than my hacky solution?

thanks


In Bash you use the command builtin to run a command wrapped in a script of the same name. e.g., script name ls is

Code:
#!/bin/bash
command ls -optiions


Another option is exec
Code:
#!/bin/bash
exec /bin/ls -options #Use the full path name.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Wrapping an executable


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway