Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Can I run a command within another command for example:

twidge update date

'date' being the bash command 'date' so effectively, twidge will update twitter with today's date.

*twidge is a CLI based twitter client

share|improve this question

2 Answers 2

up vote 10 down vote accepted

You can try escaping the command like so

twidge update "$(date)"

Which will execute date and concatenate the output of the command into the twidge command.

According to the twidge help info

You can also omit the status, in which case a single line will be read from stdin and taken as your update. Example:

date | twidge update

Just pipe the command to twidge via stdin.

share|improve this answer

Yep, if I understand you properly, this will do it:

twidge update `date`

If twidge doesn't like it, try twidge update "$(date)", quotation marks to pass it in as one long string.

share|improve this answer
    
Ah drats, twidge didn't like it, but thank you anyway, this information will prove useful later on no doubt. –  Switchkick Oct 15 '10 at 4:30
5  
The use of `` is deprecated, but anyway, if you prefer to use it you can do "`date`" –  enzotib Oct 15 '10 at 5:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.