Executing a command named in a variable

NoOp glgxg at sbcglobal.net
Wed Dec 2 00:37:20 UTC 2009


On 12/01/2009 01:52 AM, Ray Parrish wrote:
> Hello,
> 
> I'm thinking of a way to set a default external editor in a bash program 
> I am writing, and need to know if it is possible to execute a command 
> named in a variable that gets set by retrieving the command line for the 
> external editor's command line from a configuration file.
> 
> Would the following work?
> 
> # set variable to command line
> ExecuteEditor="/usr/bin/gedit filename.ext"
> # execute external command.
> $ExecuteEditor &
> 
> If this does not work, is there any other way to retireve the command 
> line of an external command and run it?
> 
> Thanks, Ray Parrish
> 

Again, I think that all of these requests for bash/script/etc are
educational (to some). But again, how do they relate to this list?

This list is for ubuntu technical support; your posts are for
bash/script/command line/programming support and have nothing to do with
this list. Perhaps you could find another list to ask these questions?







More information about the ubuntu-users mailing list