You are not logged in.
I am trying to figure a way to construst a command in bash [or python]
syntax is
command 'function string'
problem being the bit inside single quotes? I want to use different strings leaving the rest of command structure as is
something like
command 'function ' + string
the function and string must be within single quotes
there must be a way round maybe its easier in python not sure??
MrG
Last edited by Mr Green (2008-02-08 06:49:10)
Mr Green
Offline
Can you give an example where it goes wrong?
Is this useful:
command="ls"
function="/hom"
string="e"
eval $command \'$function$string\'
Offline
Woah!!!! eval is what I was looking for.... thought just running command and adding strings would work but no
/me hugs Gilneas
the escape \ also helps
Thanks very much I'm off to write it in python lol
Mr Green
Offline
Bah, such sarcasm stings deeper than you think.
Offline
Actually, who the hell do you think you are to insult someone so who tries to help you?
Your post actually has more hints of spite than sarcasm.
If this behaviour is acceptable now in these forums, I'm not staying here for another second.
Offline
??? Did I miss something?
larch: http://larch.berlios.de
Offline
Gilneas: I really don't think anything of offense was meant in that post. In fact I'm not to sure where you could have got offended (the comment about going to use python after your help in bash?). My reading of this was that Mr Green was thankful for your help.
Anyway, something obviously annoyed you enough to come back four hours later and repost here. In fact, your second post is probably going beyond what is acceptable here. If someone offends you or is abusive, etc, then you should use the "Report" link to contact a forum moderator about it, not retaliate with a similarly offensive post.
Last edited by Allan (2008-02-08 06:24:41)
Offline
Bah, such sarcasm stings deeper than you think.
Ooops did not mean anything by it, Python what I meant was use os.popen I am not much of a bash coder [hence the post!] I did search for the answer but was looking for the wrong thing such as echo $command etc..
I do apologize if I said anything to offend you, I was merely grateful for your help
MrG
Mr Green
Offline
I thought I wasn't helpful and you were mocking stupid things in my post.
I'm sorry for the false accusations.
It happened because I had an oncoming flu and a small fever, so I wasn't thinking clearly. I also need a little break, when you're reading too many posts you spend less time understanding them.
Offline
not a problem I am [most of the time!] careful in what I post
I am using your answer in a bash script a couple of lines...
hope you are ok, yes I need a break too :-)
MrG
Mr Green
Offline