In the below code I am trying to combine two shell into one, but not sure if Im doing it right. Basically, there are 3 steps:
Step 1: the file conversion (which is underlined and asks the user if the file needs to be converted, if "y", then it runs the perl script if "n" then it skips to line 14
)
Steps 2 and 3 already seem to work, but are asking the user if it is a batch or individual analysis, and if "y" one perl script is run, if "n" then another user prompt and perl command is run. Thanks .
AFAIK there is no 'goto' in bash, only in assembler and [Q{uick}|Visual] Basic.
Also, there is an incomplete (failing), yet unrequired, 'do loop' in the middle.
Furthermore, each case needs a closing esac.
Unless your files are named like: [yYnN]-matched* there will be a filename error.
Try setting another var according to 'id's value, or rename 'id' to 'answer' or alike and then change 'id' as accordingly.
Could you post a clear description of exactly what your program's supposed to do, please? We've all kind of been working from your original, and I'm no longer sure that's anything resembling what you wanted.
Quote:
Originally Posted by sea
AFAIK there is no 'goto' in bash, only in assembler and [Q{uick}|Visual] Basic.
And C. Not often used, but sometimes one goto is better than 5 nested something-else's.
Currently I have two different shell files (one that converts files and one annotates).
The conversion shell is:
and allows the user to enter the id of the file to be converted without knowing the code.
The annotation shell:
allows the user to enter a batch or individual analysis without knowing the code.
---------- Post updated at 12:02 PM ---------- Previous update was at 11:07 AM ----------
Currently I have two different shell files (one that converts files and one annotates).
The conversion shell is:
and allows the user to enter the id of the file to be converted without knowing the code.
The annotation shell:
allows the user to enter a batch or individual analysis without knowing the code.
What I am trying to do is combine the two into one shell and based off of user input "y or n" different commands are run.
For example, the user is asked if the file needs to be converted and type "y", so a script associated with a "y" response is run
that part of the code loops unless "n" is typed then it skips to line 14. I hope this helps and thank you .
I mean like this: http://shells.red-pill.eu/
Can anyone explain how this works? I hope my post is not spam. I think its related to linux. Thank you (1 Reply)
I'm taking a LINUX and UNIX class and we are using bash as the shell in terminal. On my mac-book I use zsh only because my professor had a pretty cool start-up file for it.
It has benefited me in becoming familiar with different shells. However, I'm having a hard time understanding the purpose... (4 Replies)
Lets say my default shell is bash and then i load up csh and then ksh. How would i exit csh without exiting ksh?
so basically i gone from bash > csh > ksh and i wish to close csh (2 Replies)
So in UNIX, I understand that there are several different shells you can be in: C, Bourne, Bourne Again, Korn, etc. I also know that you can write scripts for the shells, by assigning it by #!/bin/csh, or sh, etc.
If I am working in the csh, do I have to write the script for the csh? Or can it... (1 Reply)
Hi the /etc/shells file is missing on some of development boxes. Is this ok? Where can I find this file?
---------- Post updated at 07:07 AM ---------- Previous update was at 07:07 AM ----------
I have solaris, linux, aix and hpux machines and on all of these machines the /etc/shells file is... (8 Replies)
To find all of the available shells in your system we can use
cat /etc/shells
but i dont find shells in my system where else i can look for same info?? (4 Replies)
Hi All,
Why does these list (below) doesn't belong to /etc/shells?
sync:x:5:0:********************// :/sbin:/bin/sync
shutdown:x:6:0:********************// :/sbin:/sbin/shutdown
halt:x:7:0:********************// :/sbin:/sbin/halt
webalizer:x:68:68:***************// ... (2 Replies)
Can you pls. tell me, why we have different shells in UNIX OS ( Eg. SunOs) and also I would like to know what is the specific difference b/w SVR and BSD ?
Thanks. (2 Replies)
I have came across the definitions of these shells korn bourne c etc .. but honestly till now i din't get the exact difference between these threes , the advantages ..... can anyone pinpoint me where it actually lies ..... don;t include me answers like aliasing in c is posible and not in bourne ..... (3 Replies)