I wrote a little menu script that searches through another script you specify and displays step-names and next to it the text of the step. The scripts are converted JCL from mainframe. It alows you to select steps you want and will then create a new script which includes only the steps you selected. It looks something like
I am using tput to position the cursor for each of the text lines and clear the lines one at a time. You can however notice the clearing/drawing, its a bit slow. I have loaded it into a table so no disk reading involved. When I display the text below the steps it is super fast, no visible delay, but then I dont have to position the cursor, just delete till end of terminal and echo the text.
Because of space, some scripts have a lot of steps plus it looks more impressive, I want to keep the layout as above.
I have been playing with flow control from the command line. i.e. If you type ^S, then type some commands nothing is echoed, then type ^Q it will echo everyting you typed etc.
I want to do the same from the script, I think I am just being thick cannot figure out how. How do I in the script emulate ^S and ^Q. I have been searching all day but most articles are about enabling/disabling flow control via IXON, not what I want.
I want to stop scrolling, do my erase of old lines and echo of new lines, then send to the screen by enabling scrolling again in the script.
Thanks!
---------- Post updated at 04:13 PM ---------- Previous update was at 04:10 PM ----------
My spaces have dissapeared, looks like below, underscore=space
Step_Selected_Text
S0010_[ ]_____S0030 #Here we do some stuff
S0020_[ ]_____cp file to otherfile
S0030_[x]_____some more commands.....
S0040_[ ]_____.
S0050_[ ]_____.
______________.
______________even more commands
______________## End of step 0030
Last edited by vbe; 02-09-2010 at 12:46 PM..
Reason: added code tags
---------- Post updated at 18:02 ---------- Previous update was at 17:58 ----------
To help you, I suppose we would need to see a bit of your script in order to understand some of the logic and figure out what could be possible solutions...
I guess what I want is to create some sort of screen buffer. Not sure if it can be achieved with flow control. I want to stop sending chars to the screen, draw the screen, then send all of the chars at once, instead of one line at a time.
Anyway here is a "Screenshot" of the script running
And here is the function that displays the step text.
At the top of the function I would like to stop display to the screen and then at the end enable it again and send all the echoe's at once.
It is probably not possible in a script. This is a Korn shell script.
STTY and Linux info
Any help with getting the display faster would be appreciated.
It is workable at the moment, but it bugs me. I know using emacs and some sort of C program would be the best, but we don't have C at our site.
Hello All,
I saw this problem on one of the forum and solved it using group-by in oracle sql, though I am a bit curious to implement it using shell script :
There is a file having number of operations :
Opeation,Time-Taken
operation1,83621
operation2,72321
operation3,13288... (11 Replies)
I am using blow script :--
#!/bin/bash
FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not
if
then
# echo "process found"
exit 0;
else
echo "process not found"
exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
Over time i have developed a library of useful (ksh) functions which i use in most of my scripts. I use the ksh's FPATH variable to locate all these functions and use a standard environment-setting-function to always have the same environment in all my scripts.
Here is how i begin scripts:
... (3 Replies)
Most shells flavors do not have associative arrays a.k.a. maps.
How would you emulate an associative array?
I had this problem once and found a working solution, but I don't want to spoil the game hence I wont tell it.
Wonder if anyone comes up with something better. (5 Replies)
Does anyone have a script they would like to share that emulates "ls -lh" in ksh on Solaris 8?
Yeah, I know. Real men don't need that wimpy "h." Well, I'm a wimp. ;) (0 Replies)
hey all,
i am trying to connect my mac to my sony DVD changer so that i can control one aspect of it with any kind of shell script or program.
the DVD player allows you to plug in a PS/2 keyboard to navigate it's on screen menu. what i want to do is use my mac to navigate my own menus, then... (0 Replies)