38

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.

dessert
  • 39,392
  • 12
  • 115
  • 163
Switchkick
  • 3,873
  • 8
  • 32
  • 59

2 Answers2

44

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.

Marco Ceppi
  • 47,783
  • 30
  • 172
  • 197
16

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.

evgeny
  • 9,475
  • 3
  • 27
  • 28