Shell programming is linear. Just place one block after the other and include a test to see if they each completed successfully:
# Block 1
# If failed, bail
# Block 2
# If failed, bail
# Block 3
Whether you're using a huge loop or a single command is irrelevant.
I'm not terribly familiar with ksh, but you should be able to find the equivalent commands for my csh custom prompt. I have this in my .cshrc file:
alias setprompt 'set prompt="\cwd: ${cwd}\% "'
alias cd 'chdir \!* && setprompt'
The prompt it gives me is
cwd: /home/user
%
with the...
This may not work any different, but it'll probably be more efficient and certainly easier to follow IMHO.
#include <stdlib.h>
#include <string.h>
char *s(const char *str, const char *replace, const char *with)
{
char *rp;
char *pos;
size_t bufsiz;
if ((pos = strstr(str, replace))...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.