Consider the steps that are executed when connecting to tilde.pink via ssh: The user is authenticated by ssh. Secondly ssh launches sh, the NetBSD shell. Then sh executes its startup scripts .profile and .shrc located in the user's home directory. And finally sh presents a prompt to the user. So if one puts the wrong commands in the files .profile or .shrc , like a command that never ends for example, one could easily be locked-out from using tilde.pink . Out of fear of being locked-out, until now I didn't modify my .profile and .shrc files. But now I'm thinking: It would be nice if one could could test sh with an alternative startup script before replacing the actual .profile and .shrc files. And indeed such a functionality exists. sh can be started with the command line option -c', which makes it execute the command specified as a further argument at the shell. So for example
sh -c ls' would execute ls'. There is also the option
-s' to sh, which makes it enter interactive mode after it has processed all commands. So let's say one has written an alternative startup script for sh and one has saved it as startup_alt. One executes the following command:
sh -c -s ". ./startup_alt"
sh executes the script startup_alt and enters interactive mode. So just as if one was invoking a shell with startup_alt as its startup script.
=> Home This content has been proxied by September (ba2dc).Proxy Information
text/gemini;