Sponsored Content
Top Forums Shell Programming and Scripting No 1 answering my question... any reason ? Post 302569219 by nanochan1 on Sunday 30th of October 2011 08:01:57 AM
Old 10-30-2011
sorry and thanks.

i don't quite understand the assistance vgersh99 provided me.

the code given what is it for ?

---------- Post updated at 08:01 PM ---------- Previous update was at 07:59 PM ----------

Quote:
Originally Posted by ahamed101
Please provide the input and the expected output and some explanation.

We are all very happy to help everyone who comes here. But like the mod said, it is a voluntary service. And more over its a weekend! Smilie

--ahamed
lets say i read in a file...

it shows the available spaces remaining from a file

eg.

Quote:
AAAAAAAAAA
AAAAA A AA

2/20 spaces remaining
if the remaining spaces are less or equal to 9 the compiler will run & allocate without any issues (as above), but if i set remaining spaces to be more than 10 spaces out of the 20 spaces

eg.
Quote:
A AA A
A A A A A

11/20 spaces remaining
my compiler will simply hang and not do anything.

what i need to do is... eg i tell the compiler i need 4 spaces to be allocated to the remaining gaps - automatically.
the compliler will then start checking through and slot whichever gaps it could find with B and my result should return like this for instance:

Quote:
ABAABABB
A A A A A
and if i need 8 spaces to be filled it will be

Quote:
ABAABABBBB
ABABA A A
and if 13 spaces needed to be filled

Quote:
ABAABABBBB
ABABABABAB
the codes which i tried to do as show on post #1 only could work for spaces not more than 9 remaining.

eg.
Quote:
AA A AA A
A A A A A

this runs fine
Quote:
A A AA A A
A A

this doesn't - as there are more than 10 spaces remaining

Last edited by nanochan1; 10-30-2011 at 09:13 AM..
 

7 More Discussions You Might Find Interesting

1. Programming

what is the exact reason ?

please refer the following 2 statements... 1) int i=1,j; j= i++ + i++; 2) int i=1,j; j=++i + ++i; how j becomes 2 and 6 for the above 2 statements respectively ??? ( i guessed j must be 3 and 5) Somebody define the exact reason please.. :( ... (2 Replies)
Discussion started by: shamal
2 Replies

2. BSD

Answering posts

Hi Guys...(if anyone is out there), do these specialist posts ever get answered and do we just have to bide our time and be patient, or whats the deal (3 Replies)
Discussion started by: Gerry405
3 Replies

3. Shell Programming and Scripting

Perl: answering automatically to install questions

Hi everybody, I have been looking for an answer to this issue both on google and on the forum, but I couldn't find anything. please help me :eek: As part of an automated (in perl) install of Solaris 9, I would like to be able to answer automaticaly to the question the installer asks.... (2 Replies)
Discussion started by: zaap
2 Replies

4. UNIX for Dummies Questions & Answers

help - question needs answering????

hey, have been set this question at school and cannot think for the life of me how to do this. Ive thought about setuid/setgid and things like that but cant make any snese of it. Can anyone help? question reads: You have a file which has the names, email addresses, mobile numbers and sales... (1 Reply)
Discussion started by: biffa
1 Replies

5. Shell Programming and Scripting

ssh -t answering automatically to the password

hi, i'm using the folowing ssh command to list the newuser "crontab' from myuser ssh -t myuser@host1 "sudo -u newuser crontab -l" this is ok but it is asking me a password. Mot de passe de myuser: The problem is that i want to answer it automatically in a shell script with the... (22 Replies)
Discussion started by: Nicol
22 Replies

6. Shell Programming and Scripting

Perl Debug Stepping Answering Questions

I am new to perl and want to get a little better understanding of debugging code in perl. I have a perl script that has questions to be answered like: he following PERL modules are recommended: Crypt::DES Crypt::PasswdMD5 IO::Pty Net::Write::Layer2 String::CRC32 Attempt to install... (0 Replies)
Discussion started by: metallica1973
0 Replies

7. UNIX for Dummies Questions & Answers

Mgetty Not Answering when Calling from Outside

Hello All, mgetty Version: 1.1.36 OS: OpenSuSE 13.1 (armv7l) Modem: Zoom 56K USB Modem Model 3095 So I've been playing with mgetty for weeks now testing dialing into the USB modem from another PC using the same modem and connecting using minicom (*minicom ---dials to---> mgetty). I had... (3 Replies)
Discussion started by: mrm5102
3 Replies
All times are GMT -4. The time now is 01:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy