Software :: Catching Signed And Unsigned Integers In BASH?
Dec 30, 2010
Solving issues with signed and unsigned numbers in BASH.For a start, Yes, BASH is type independent � I know that. My problem lays in catching executables output into a BASH variable.My executables are not quite UNIX compatible, where returned values are 0 for OK, >0 ERROR. They return 0 for OK, >0 WARNING (only, so move on) and <0 ERROR (abort) instead.
Code:
// C++ BIN A
int main(){
[code]...
View 4 Replies
ADVERTISEMENT
Mar 24, 2009
From what I understand, if I attempt to increment an unsigned int which is already at its max value, it will flip back to zero.Question: is this guaranteed to happen by the C language? That is, can I count on this happening on all platforms?(Of course, I recognize that the max value of the int will change from platform to platform...)
View 5 Replies
View Related
Mar 17, 2010
i am dealing with this problemI have a function
function Une {
...
return $some_variable
[code]...
View 6 Replies
View Related
Sep 9, 2010
I've been trying to find a bug in this test script, but haven't been able to so far. I'm not lazy, I promise...just new to Bash so am having a hard time catching syntax errors. I call the script with the option -disableVenusBld, and it still prints "Starting build", which it shouldn't be doing right?
[Code]...
View 1 Replies
View Related
Jun 24, 2011
I've been debugging the following script all evening and am now stuck...this script is supposed to ssh to a router, pull interface conf, 'cut' 3 pieces of info, and then print the results of 2 as well as the 3rd (after running a ping cmd on the linux box):
SCRIPT_CODE
#! /bin/bash
lb1="0"
[code]....
View 4 Replies
View Related
Oct 14, 2010
am trying to upload packages o a PPA (packages that contain custom "sources.list"s designed to make upgrades or downgrades between Ubuntu releases easier) and, even after going through all that work to manually generate a key and sign them with gpg, dput still rejects them as "not signed".
View 3 Replies
View Related
Nov 8, 2010
I have a string, like file223a3b5. How can I extract the number beginning after "file" and ending before "a"?
View 3 Replies
View Related
Aug 23, 2009
Code:
#include <stdio.h>
int main ()
[code]...
View 7 Replies
View Related
Mar 4, 2009
I am aware that this question has been asked before and I have also tried the solution suggested but I am still not able to figure it out why I am getting some wierd results when I am using printf with a 64 bit signed and unsigned integer in C.I am running Suse 10.2 on a Intel(R) Pentium(R) M processor 2 GHz.I tried to call functions strtol strtoll strtoul and strtoull with different integer sizes and these are the results i get from my program shown below:
int i;
char str[100];
char endstr[100];
[code]...
View 6 Replies
View Related
Dec 26, 2010
Im just setting out on the long road to learn python so please excuse my lack of knowledge.Im initally trying to read a csv in and print only certain "elements" (not sure if thats the right term) from a list. But I am getting the error :TypeError: list indices must be integersMy Code is :
Code:
#!/usr/bin/python
import csv
[code]...
View 2 Replies
View Related
Oct 1, 2010
this might be an interesting one for the bash scripting gurus. I seem to break my teeth on it. The mission:- do a dd over ssh to trasnfer an image to another host- capture the dd PID on the other side- send a USR1 kill signal to it- capture that output on the original host It goes wrong on the last part. This is what I have before that step:dd if=image.gz | gzip -d | ssh host2 "dd of=/dev/vg1/lv1" &PID=`ssh host2 ps aux |grep dd|grep lx05|awk '{ print $2 }'`when I do "ssh host2 kill -USR1 $PIDI get nice outputs to the screen. When I replace the first line with:dd if=image.gz | gzip -d | ssh host2 "dd of=/dev/vg1/l01 2>/tmp/output.txt" &the dd command seemd to die. I suspect a problem with the pipe, since this does work when executing locally on a host without piping.
View 4 Replies
View Related
Jun 7, 2010
Is it possible to catch the power management events(hibarnate/standby/sleep)o the code(c++)?
View 2 Replies
View Related
Mar 10, 2010
How do I catch the output of split and redirect it to another directory?for example,if my working directory is 'Documents' and I split a file called text.one into 4 files of 100 lines each (xaa, xab, xac, xad), how would I get those split files to be written into 'Directory/subdirectory' instead of 'Directory'?And is it possible to rename those split files so that the split name is suffixed with the original file's name e.g instead of xaa, xab... can they be written as text.one.xaa, text.one.xab..?I've thought about using '>' to send the output to a new directory but it doesn't work; and I've thought about piping the results to another command but I don't know what that other command should be.
View 2 Replies
View Related
Oct 16, 2009
I'm running FC10, with the sendmail that was part of it in Feb 09. Anyway, Up till now I've been using the user client to do spam filtering, But I'd like to start catching the spam at the sendmail level. What are my options today? I tried searching the forums and found a bunch of threads from 2001-2006, but I figured many of the ideas are now longer vaild.
View 2 Replies
View Related
Apr 26, 2011
Is it possible to handle multiple signals in just one handler? I only know singal() catches one signal at a time
View 2 Replies
View Related
Jul 21, 2010
I followed this how to document [URL] to install postfix, Amavisd, SpamAssassin and ClamAV. My postfix installation is working fine and I can send and receive emails fine. However, it looks like SpamAssassin is not catching any emails. Emails do get passed over to Amavisd as I can see in the logs but ALL Messages comes out CLEAN without being tagged as spam.
As per the document, I did test by sending a test virus email
sendmail -i your-address@example.com < sample-virus-simple.txt.
This is caught and NOT let through so ClamAV is ok but when i send
sendmail -i your-address@example.com < sample-spam-GTUBE-junk.txt
it does get delievered without being detected as SPAM or tagged as SPAM.
As I said, I have followed the documentation dot by dot and hence do not have spamassassin starting up as a service but i guess amavisd starts it within itself as a module.
Also, my postfix version is the one that supports mysql virtual tables which I got from rpmforge.
View 6 Replies
View Related
Nov 27, 2009
I just installed F12 the other day and I've run into my first problem (this is not a knock, in fact this is probably the best release of Fedora 12 ever for me). Installing Skype from their website. I realise that I'm attempting to install an 1586 binary in x86-64 so it's risky, but that's not the point (yet anyway). I can't even get it to install. I've looked around and can't find anything meaningful on this (other than posts which provided no help). When I try to install the rpm from [URL] with the GUI, I get the message "This action cannot be completed" with the following under details: "The name org.freedesktop.PackageKit was not provided by any .service files". I then tried to install it from a root terminal and got the message, "Package skype-2.1.0.47-fc10.i586.rpm is not signed". Is there a way to change this behavior? And is there a temporary workaround (say, for just this app)? All in all, I love this release, but I cannot recommend Fedora 12 to someone new to Linux without alleviating this issue for them (I'm set to do this tomorrow). This would hamper their efforts to learn how to do basic things, such as installing a random program like Skype.
View 5 Replies
View Related
Jan 8, 2010
I am trying to create a table T having a field F which should be able to store variable-length sequences of "unsigned" characters (8bit values ranging from 0 to 255 (not including 0, including 255)).(MAX_LENGTH) is not working, as it seems to want sequences of 8bit values ranging from 0 to 127 (thus "signed" characters).Can anyone help me by pointing out if there is a type suited for my needs (or if such a type does not exist)?For those familiar to C programming and working with the MySQL client library, I should be able to (successfully) do something along the lines of:
Code:
unsigned char value[] = { 'H', 'E', 'L', 'L', 'O', -1, -128, 'W', 'O', 'R', 'L', 'D' };
unsigned char query[255];
[code]....
View 3 Replies
View Related
Jul 15, 2011
I just created an rpm and went to install it on another fc12 vm - it said the package was not signed. I searched on this and one place said to edit the yum.conf file to:
gpgcheck=0
View 2 Replies
View Related
Jun 8, 2009
How do I install an unsigned RPM, like Cedega, or RPM Wizard?
View 1 Replies
View Related
Mar 13, 2010
You are about to install unsigned packages can compromise your system, as it is impossible to verify if the software came from a trusted source. Are you sure you want to continue installation?YES confirm with password same error, yes confirm with pass same error..
View 2 Replies
View Related
Oct 17, 2010
I am a dummy in C programming. I have a problem with copying the array of 64 elements of unsigned char to array of 8 element of uint64_t. For example:
unsigned char p[64]
uint64_t Data[8];
memcpy (&Data, &p, 64);
I am not sure if it is right. Please help me. Thanks a lot.Moreover, do both p and Data have 64 bytes?
View 2 Replies
View Related
May 16, 2011
How can I add self-signed certificates to e.g: Google Chrome under Linux (from the command line)?
View 1 Replies
View Related
Apr 5, 2010
Has anyone setup a system to only allow digitall signed (i.e. approved USB disk drives) to be used on a Linux System.
View 1 Replies
View Related
Feb 23, 2011
build a Linux environment in which only "signed" processes are allowed to run. When I say signed I don't mean a VeriSign etc. signature like you know it from Windows, but I mean signed by myself. I.e. I choose the software allowed to run, sign it, and then want to deny any other processes to run.If it is somehow possible I'd like to extend this even to scripts and the kernel (i.e. no unsigned modules can be loaded).Does anyone have a good idea how to solve this problem?The bad thing is: I'm pretty fine with coding stuff myself in C, but have absolutely 0 experience or knowledge in kernel (module)-programming.Any tipps, links, literatureOne approach I came up with (just a rough idea at the moment):Linux starts new processes with a fork-and-exec-combination. I therefore wonder if it is possible to change exec() in such a way that it will only execute signed programs
View 5 Replies
View Related
Jul 22, 2009
I have a server which I use for mail:
[URL]
The above is the machines actual FQDN. Now because I also use it as a web server to access my website and webmail, I have a pointer record with my domain registrar to also forward all [URL] to the same IP as [URL]. when I generate a SSL self signed certificate for my server. Do I generate one for [URL] or [URL]?
View 2 Replies
View Related
Feb 20, 2011
I'm writing a tridiagonal solver for sparse linear systems and I coded this decreasing loop:
PHP Code:
xx[NN - 1] = gamma[NN - 1]*BB[NN - 1];
ii = NN - 2;
/* Compute the x values: */
while (ii >= 0) {
xx[ii] = gamma[ii]*(BB[ii] + xx[ii + 1]);
ii = ii - 1;
}
now... if ii is declared as an unsigned integer, the code gives me a segmentation fault, but if I declare it as an int, it doesn't. Using DDD I noticed that, as an unsigned int variable, when I finally decrease it, it underflows and blows up to a huge value, ergo giving me an unaccesible direction for xx in the following iteration! I taugh me not to use unsigned int variables for dereasing loops! XD
View 14 Replies
View Related
Jul 21, 2011
I copied and test a simple random number generate program
#include <algorithm>
#include <vector>
#include <iterator>
#include <iostream>
[code]....
View 2 Replies
View Related
Oct 31, 2010
I am running Ubuntu 10.04.How do I make Synaptic stop giving warning messages about unsigned repositories?
View 2 Replies
View Related
Nov 19, 2009
i just read that in fc12 you can install sighned packages without root password?
View 1 Replies
View Related