Posts

Showing posts from February 26, 2019

Guayaquil

Image
This article is about the city of Guayaquil. For the canton named after this city, see Guayaquil (canton). This article may be expanded with text translated from the corresponding article in Spanish . (December 2015) Click [show] for important translation instructions. View a machine-translated version of the Spanish article. Machine translation like Deepl or Google Translate is a useful starting point for translations, but translators must revise errors as necessary and confirm that the translation is accurate, rather than simply copy-pasting machine-translated text into the English Wikipedia. Do not translate text that appears unreliable or low-quality. If possible, verify the text with references provided in the foreign-language article. You must provide copyright attribution in the edit summary accompanying your translation by providing an interlanguage link to the source of your translation. A model attribution edit summary (using German): Content in this edit i...

Pass commands as input to another command (su, ssh, sh, etc)

Image
18 8 I have a script where I need to start a command, then pass some additional commands as commands to that command. I tried su echo I should be root now: who am I exit echo done. ... but it doesn't work: The su succeeds, but then the command prompt is just staring at me. If I type exit at the prompt, the echo and who am i etc start executing! And the echo done. doesn't get executed at all. Similarly, I need for this to work over ssh : ssh remotehost # this should run under my account on remotehost su ## this should run as root on remotehost whoami exit ## back exit # back How do I solve this? I am looking for answers which solve this in a general fashion, and which are not specific to su or ssh in particular. The intent is for this question to become a canonical fo...