I am working on a menu for linux... some basic stuff.
but I have an issue. I got 1 server where something is working and the same thing does not work in the same way in another linux box
Basically I am simulating a command line where user insert some commands and to end and go back to the previous menu that person has to press Control + C and Enter Key
all my server are centos 5.0
I am adding my menu here
basically you execute ./menu
After that go to option
9. Opciones
7. Ejecutar comando
and execute a command like pwd
after that
Press Control + C and Enter Key
but I got error ./menu: break: cannot break
but in other servers pressing Control + C and Enter Key goes back to previous menu
any idea how to fix that?
or another way to exit from that simulated command line and go back to previous menu where I selected 7. Ejecutar comando
Basically this is the part that has issues
menu (code) is attached so you can see all options
thanks a lot
Update
Uploaded as menu.txt just remove .txt and test it
Zip files can potentially include viruses, etc... Further, they complicate the whole process of assisting in solving the problems.
If your example is too large, simply cut/paste a few records/rows of data into your post (making sure to enclose it inside codetags).
Zip files can potentially include viruses, etc... Further, they complicate the whole process of assisting in solving the problems.
If your example is too large, simply cut/paste a few records/rows of data into your post (making sure to enclose it inside codetags).
I will add it as txt
---------- Post updated at 07:26 PM ---------- Previous update was at 02:03 PM ----------
well guys I ended doing this
I don't know if it's the best way but that's the only thing that came to my mind
Code:
ejecutacmd ()
{
header
echo -e "Digite ${bold}end${offbold} para finalizar"
echo -e " "
while [ "$whichcmd" != end ]
do
read whichcmd?"Enter Command: "
$whichcmd
done
whichcmd=0
Okay so I am having trouble understand what the computer will do with a code like this
if ; then
echo
echo "Found the file"
blah blah blah
for i in `blah blah blah` ; do
... (2 Replies)
...when the lines use both a colon and commas to separate the parts you want read as information.
The first version of this script used cut and other non-Bash-builtins, frequently, which made it nice and zippy with little more than average processor load in GNOME Terminal but, predictably, slow... (2 Replies)
Greetings.
cat $name$telephonenumber >> telephonebook.txtI would like to break cat with the command 'break'. Pretty hard to understand huh? So to clarify it:
echo "If you want to stop adding datas to your telephonebook please type 'break'
if #this part is probably not good
then
echo... (2 Replies)
I am wondering how can I take a variable that may have multiple items of data and to use each one indenpendently.
For example lets say that....
data=/lcl/apps/trm, /lcl/apps/wwe, /prd/sse/qwe, /lcl/ppe/eer
Now I would like to be able to process each item found within the data string. As... (5 Replies)
Hi,
i have a file say samp.s which has
123 a b c d
123 e f g h
123 i j k l
123 m n o p
234 a b c d
234 e f g h
234 i j k l
the first 3 characters in each line are considered the key values
i have one more file temp.txt which has
123
234
i want to have a page break in... (5 Replies)
I have this script lines
#!/usr/bin/bash
my_path=`dirname $0`
I_table=$1
echo $I_table
in I_table entry going is ccc_con,cc_gui
I want to break content of I_table in S_Table and T_table on basis of comma as separtor (2 Replies)
have a query on this break. I am using a program where I am using a while loop to execute it. It will get into a file take the first file and then ping it and if the ip is reachable then it will mail. Now what happens is that when i ping the ip it does nopt come out of the loop and it says "reply... (11 Replies)
Does anyone know how to send break on a Blade 100?
I'm using a serial cable on my laptop and I can see the system boot up just fine, but I want to send break so i can have it boot from cdrom instead of disk. (3 Replies)
hi All,
Have a doubt in ksh..Am not familiar with arrays but i have tried out a script..
plzzzzz correct me with the script
My i/p File is:
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = TCP)
(Host = 192.168.2.2)
(Port = 1525)
)
)
(CONNECT_DATA = (SID = TESTDB1)
)
)
... (7 Replies)