473,490 Members | 2,487 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Need to understand what this for loop will do?

72 New Member
HI All,

Can any one please let me know what this for loop is trying to do

for V in ${MYVERSION[$I]:-"$VERSION"}

what :- stands for? I dont understand this condition,
Can any one help me please?

Thanks
Manjuks
Dec 16 '10 #1
3 1601
chorny
80 Recognized Expert New Member
This code does not look like Perl
Dec 16 '10 #2
numberwhun
3,509 Recognized Expert Moderator Specialist
@chorny is right, its not Perl code. Its actually Bash shell scripting code.

Here is an excerpt from the Bash man page:

${parameter:-word}
Use Default Values. If parameter is unset or null, the expansion of word is substituted. Otherwise, the value of parameter is substituted.

Regards,

Jeff
Dec 16 '10 #3
manjuks
72 New Member
Hi thanks Jeff.
It made me clear, In my case both MYVERSION[$I]and "$VERSION" are NULL. It means It should not go inside the for loop.

But In Solaris KSH it was getting inside the for loop, and in Linux KSH it was not. Its because of KSH version mismatch.

Thanks,
Manjunath
Dec 24 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

12
1687
by: Steve | last post by:
Hi, I'm getting some output by running a command using os.popen. I need to parse the output and transform it in some sense so that it's 'DB compatible', (i.e I need to store the output in a...
5
2213
by: Hennie de Nooijer | last post by:
Hi, This is a diffcult issue to explain. I hope to make my problem clear to you. SITUATION I'm building A SLA Query for a customer. This customer has an awkward way to determine the SLA results...
3
2354
by: visual basic dummy | last post by:
I have taken a course at the local college. It is called Advanced Languages and this course will cover C++, Perl and Javascript. I must pass this course. In January/Feb we covered a 1000+page...
0
2684
by: YFS DBA | last post by:
I'm getting an error message when I open queries then try to close them: "This action will reset the current code in break mode" Clicking on 'Yes' just brings up the same message. If I change...
2
1840
by: Sean Hammond | last post by:
Anyone understand this? Python 2.4.4c1 (#2, Oct 11 2006, 21:51:02) on linux2 Type "help", "copyright", "credits" or "license" for more information. .... """Send 'input' (string) to the...
1
1459
by: rebellion | last post by:
write a c++ program that will continuously accept a number. the loop will stop if the user enter a number which is less of equal than the previous. ex. if i input 2 then my next input is 4 ...
2
4328
by: mika_ella258 | last post by:
the output should be like this Loop Program -------------------- enter 1st integer: enter 2nd integer: enter 3rd integer: enter 4th integer: enter 5th integer:
4
1615
by: chellemybelle | last post by:
Hello, I basically have made a little cheezy slideshow and would like to add captions to each pic as it loops through. I've tried everything I can think of. I'm assuming I might need to use an...
2
201
by: dp_pearce | last post by:
I have some code that takes data from an Access database and processes it into text files for another application. At the moment, I am using a number of loops that are pretty slow. I am not a...
1
1504
by: Kristoffer | last post by:
I can't comprehend that this loop isnt working in practise as in my head it makes perfect theoretical sense while(fscanf(input, "%c", &c)==1) { i = 0; while(c!=';') { printf("%c",...
0
6974
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6852
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7356
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5448
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4878
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
628
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
277
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.