i=0 #fill an Array with all files in a folder ending with .sys
for Par in *.sys ; do
Par2[$i]="$Par" ;
i=$((i + 1)) ;
done
#fill the "control variable" with the value of the Array
a=${Par2[0]} ; b=${Par2[1]} ; c=${Par2[2]}; d=${Par2[3]}; e=${Par2[4]}; f=${Par2[5]}; g=${Par2[6]}; h=${Para[7]}; i=${Par2[8]};
#remove the file extension (.sys) for each control variable (a,b,c,...)
a=`echo $a | sed 's/\(.*\).sys/\1/'` ; b=`echo $b | sed 's/\(.*\).sys/\1/'` ; c=`echo $c | sed 's/\(.*\).sys/\1/'`; #...
echo "simulation models"
echo "---------------------------------------"
echo " $a "
echo " $b "
echo " $c "
#...
echo " $i "
sleep 2
echo " ++---------------------------------+"
echo " || 01 (TI+MM) --> calculate all (a-i)"
echo " || 02 (TI+MM) --> calculate $a "
echo " || 03 (TI+MM) --> calculate $b "
echo " || 03 (TI+MM) --> calculate $c "
#...
echo " || 09 (TI+MM) --> calculate $i "
read ANTW
case $ANTW in
01) command1
02) command2
03) command3
#...
09) command 9
esac
The script works, but its really big and i think that it can rephrase in a better way retaining the functions unchanged.
Another problem is, that the variables in my script go from a to i. So if there are for example 50 .sys-files in the folder it ignores the last 41.
Hello,
FIRST QUESTION:
I am writing a script in which a query is taken at the beginning of the script to be later used at the end. In the query, variables are generated from a loop, and I would like to assign the variable NAME (not value) with an appended 1, 2, 3, 4.....n. The number of... (2 Replies)
Hello everybody,
I am having problem in converting byte array variables to Hexa String variables for Linux. I have done, converting byte array variables to Hexa String variables for Windows but same function doesn't work for linux. Is there any difference in OS ? The code for Windows is given... (2 Replies)
Hi,
I am very new to scripting and have a question regarding variables and their use in a bandwidth monitoring script.
I have identified a few primary variables being;
Bandwidth CIR Download=32kbits <- these match as per the script below
Bandwidth PIR Download=96kbits
Bandwidth CIR... (1 Reply)
I want to be able to control click (Mac) and be able to select from a context menu...run file....and have it dynamically run based on the control click.
How do I get the control click absolute path of the filename? Are there different variables like directory, fullpath, extention? (0 Replies)
Hi All,
i have a requirement where i have to run a script with at least 25 arguements and position of arguements can also change. the unapropriate way is like below. can we achieve this in more good and precise way??
#!/bin/ksh
##script is sample.ksh
age=$1
gender=$2
class=$3
.
.
.... (3 Replies)
Sometimes it is handy to protect long scripts in C++.
The following syntax works fine for simple commands:
#define SHELLSCRIPT1 "\
#/bin/bash \n\
echo \"hello\" \n\
"
int main ()
{
cout <<system(SHELLSCRIPT1);
return 0;
}
Unfortunately for there are problems for:
1d arrays:... (10 Replies)
Hi,
I am trying to write a shell script to help with some digital signature work currently being undertaken where we have a file that contains a number of rows ending with ^M.
What I need to do is concatenate this using shell scripting and retain the control character. E.G.
abc^M... (5 Replies)
Below are three variables, which I want to pass into variable RESULT1
username1=userid
poihostname1=dellsys.com
port1=8080
How can I pass these variables into below code...
RESULT1=$((ssh -n username1@poihostname1 time /usr/sfw/bin/wget --user=sam --password=123 -O /dev/null -q... (4 Replies)
Discussion started by: manohar2013
4 Replies
LEARN ABOUT OPENSOLARIS
echo
echo(3XCURSES) X/Open Curses Library Functions echo(3XCURSES)NAME
echo, noecho - enable/disable terminal echo
SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib
-R /usr/xpg4/lib -lcurses [ library... ]
c89 [ flag... ] file... -lcurses [ library... ]
#include <curses.h>
int echo(void);
int noecho(void);
DESCRIPTION
The echo() function enables Echo mode for the current screen. The noecho() function disables Echo mode for the current screen. Initially,
curses software echo mode is enabled and hardware echo mode of the tty driver is disabled. The echo() and noecho() functions control soft-
ware echo only. Hardware echo must remain disabled for the duration of the application, else the behavior is undefined.
RETURN VALUES
Upon successful completion, these functions return OK. Otherwise, they return ERR.
ERRORS
No errors are defined.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |Unsafe |
+-----------------------------+-----------------------------+
SEE ALSO getch(3XCURSES), getstr(3XCURSES), initscr(3XCURSES), libcurses(3XCURSES), scanw(3XCURSES), attributes(5), standards(5)SunOS 5.11 5 Jun 2002 echo(3XCURSES)