06-13-2013
Thanks Don Awesome!!, i tested the script it's working fine with no single error. How ever i have few questions.
1) Is "${i#*[*]}" same as "${i#**}" when i tested it is giving same results, may i please know the purpose of those square brackets then, additional check or something?
2) [ "$VER_NUM" -gt "$MAX_V" ] && MAX_V=$VER_NUM
Here it will check if VER_NUM is greater than previous version and if it is then save it to MAX_V, probably another syntax or way of assigning a value to variable.
3) IAm=${0##*/} --- Trying to debug this but don't understand completely. As per my assumption you were using this in conjunction with printf to print the output? may i please know what does each of those${0##*/} represent?
4) printf "$Usage" "$IAm" "$1" >&2 --- i know you are redirecting to standard output, and you are passing Usage & IAm variables along with input argument(provider_code). Much appreciate if you could explain a bit.
Thank you.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I wrote this script with the help of you guyz.My next challenge is to increment the port using single file.So far iam using this code to increment hp1 and hp2 .To increment port numbers, iam using two different files (.default_port_hp1 and .default_port_hp2).The challenge for me is to use... (0 Replies)
Discussion started by: coolkid
0 Replies
2. Shell Programming and Scripting
morning guys and gals,
I am haveing a problem, a friend helped me out with this script but i dont know how to add incrementing number for each movie in movie.list. this is what i have so far. any assistance would be great.
I have removed the GT and LT symbols so you can see what is going on... (5 Replies)
Discussion started by: Optimus_P
5 Replies
3. Shell Programming and Scripting
I have the following code and getting the error
./raytrac.bash: line 231: ((: 0++: syntax error: operand expected (error token is "+")
iarg = 0
iarg=0
narg=$# # Number of arguments passed.
echo "narg = $narg"
argsArr=("$@") # Set... (1 Reply)
Discussion started by: kristinu
1 Replies
4. Shell Programming and Scripting
Hello,
Here's a file of mine:
key1:431
key2:159
key3:998
I need to change these keys to something bigger - and I actually need to shift them all by a range of 3.
The output would be:
key1:434
key2:162
key3:1001
I can't find the propper sed/awk line that would alter all my... (4 Replies)
Discussion started by: fzd
4 Replies
5. Shell Programming and Scripting
Dear all
Say I have a file as
! TICKET NBR : 234 !GSI : 102 ! 3100.2.112.1 11/06/2013 15:56:29 ! 3100.2.22.3 98 ! 3100.2.134.2 8 !
! TICKET NBR : 1809 ! GSI : 102 ! 3100.2.112.1 11/06/2013 16:00:45 ! 3100.2.22.3 65 ! 3100.2.134.2 3 !
! TICKET NBR : 587 ! GSI : 102 ! 3100.2.112.1... (3 Replies)
Discussion started by: OTNA
3 Replies
6. Shell Programming and Scripting
I have number in file which contains date and serial number:
2013101000.
The last two digits are serial number (00). So maximum of serial number is 100.
After reaching 100 it becomes 00 with incrementing 10 which is day with max 31.
after reaching 31 it becomes 00 and increments 10... (31 Replies)
Discussion started by: Natalie
31 Replies
7. UNIX for Advanced & Expert Users
Two questions:
1) Is there a way to create a new column (i.e. ID) to an existing file containing data and the new column ID populate as an auto incrementing number?
for example:
(Current file has headers and is PIPE delimited.)
**data looks like this**
"COL1"|"COL2"|"COL3"|"COL4"|"COL5"... (0 Replies)
Discussion started by: timlisa20
0 Replies
8. UNIX for Advanced & Expert Users
Two questions:
1) Is there a way to create a new column (i.e. ID) to an existing file containing data and the new column ID populate as an auto incrementing number?
for example:
(Current file has headers and is PIPE delimited.)
**data looks like this**
"COL1"|"COL2"|"COL3"|"COL4"|"COL5"... (4 Replies)
Discussion started by: timlisa20
4 Replies
9. UNIX for Beginners Questions & Answers
Hi,
This is my first post here.
I am using cygwin on Windows 7.
I am starting with a data file with filename "name_1.ext", like "20180831_snapgenotypes_1.csv".
The "_1" before ".ext" is a version number. Integers (0-99) are sufficient. They don't have to be like "1.0.0".
The filename may... (2 Replies)
Discussion started by: minimalist
2 Replies
10. UNIX for Beginners Questions & Answers
Hi
I am unix newbie looking for a unix bash script that can make it easier to do my code work. we have a code number for each code block that we want to incrementally assign. We have 10000 of these and it is very laborious to do this one by one.
so what we want is start from the top of the... (4 Replies)
Discussion started by: chamajid
4 Replies
LEARN ABOUT DEBIAN
mouse_b
mouse_x(3alleg4) Allegro manual mouse_x(3alleg4)
NAME
mouse_x, mouse_y, mouse_z, mouse_w, mouse_b, mouse_pos - Global variable with the mouse position/button state. Allegro game programming
library.
SYNOPSIS
#include <allegro.h>
extern volatile int mouse_x;
extern volatile int mouse_y;
extern volatile int mouse_z;
extern volatile int mouse_w;
extern volatile int mouse_b;
extern volatile int mouse_pos;
DESCRIPTION
Global variables containing the current mouse position and button state. Wherever possible these values will be updated asynchronously,
but if mouse_needs_poll() returns TRUE, you must manually call poll_mouse() to update them with the current input state. The `mouse_x' and
`mouse_y' positions are integers ranging from zero to the bottom right corner of the screen. The `mouse_z' and `mouse_w' variables hold the
current vertical and horizontal wheel position, when using an input driver that supports wheel mice. The `mouse_b' variable is a bitfield
indicating the state of each button: bit 0 is the left button, bit 1 the right, and bit 2 the middle button. Additional non standard mouse
buttons might be available as higher bits in this variable. Usage example:
if (mouse_b & 1)
printf("Left button is pressed
");
if (!(mouse_b & 2))
printf("Right button is not pressed
");
The `mouse_pos' variable has the current X coordinate in the upper 16 bits and the Y in the lower 16 bits. This may be useful in tight
polling loops where a mouse interrupt could occur between your reading of the two separate variables, since you can copy this value into a
local variable with a single instruction and then split it up at your leisure. Example:
int pos, x, y;
pos = mouse_pos;
x = pos >> 16;
y = pos & 0x0000ffff;
SEE ALSO
install_mouse(3alleg4), poll_mouse(3alleg4), mouse_needs_poll(3alleg4), exalpha(3alleg4), exlights(3alleg4), exmouse(3alleg4),
exshade(3alleg4), exspline(3alleg4), extrans(3alleg4)
Allegro version 4.4.2 mouse_x(3alleg4)