Programming :: Script Exit Code To System() C Function?
Jul 3, 2009Consider the following code:
Code:
...
int ret=0;
[code]...
Consider the following code:
Code:
...
int ret=0;
[code]...
I have this command in ksh:
1. typeset -i INTEGER INTEGER=aaa In all platforms except of Linux it is failing and return exit code 1 Why in Linux it is not failing? I must it for my number tests
2. The same for printf command. Only in Linux the bellow command is not failing: printf "%d" aaa
How do i run a part of code on exit in a shell script?Suppose i have four echo statements like the following:
echo "Stmt 1"
echo "Stmt 2"
....some code goes here...
[code]...
I bought a new SD card which I intend to put some MP3s on - except that I can't write to it because it tells me the destination is Read Only. No-probs thinks I: I'll just reformat it.
"Error creating file system: helper exited with exit code 1: cannot open /dev/mmcblk0p1: Read-only file system"
Various chmod commands all result in Read-only file system. I tried umount then mount commands, but it couldn't find it to mount once I'd unmounted it using the same /media/ file path (I assume it's the only one).
I'm trying to write some code that involves creating a function to return a vector iterator.I'm not sure what is wrong.
Code:
template <typename T> class VectorTemplate
{
[code]....
when i want copy something from dvd my debian squeeze is total slow cpu ussage is 100% and write 2.2 mb/s and musick is stop and play. This same is on burning cd /dvd the device buffer is an about 10-15% this dvd is Pionier 116D on windows xp work perfect. I try benchmark dvd form gnome-disk-utility but i got Error benchmarking: helper exited with exit code 1: Device /dev/sr0 is too slow to benchmark
[Code]....
( everything works on debian lenny on the old kernel 2.6.26 ) I instaling a few kernel and compiling 2.6.35.7 with .config file form ubuntu on finaly didn't help
I noticed that if I have "exit" in a bash script file., e.g. script.sh,that when the word "exit" is reached, and the script file being executed is not in the PATH nvironment, i.e. ". script.sh", the whole konsole shell profile is exited! What gives here? Is there another command compatible to "exit" to prevent this, or will I just have the leave the "." part in the PATH enviroment, which is, to my understanding, is not recommended? I desire for a "goto" function in bash script files
View 11 Replies View RelatedIn linux, creating thread is same as process (clone()), except the virtual address space gets shared with the parent.If a running main process(thread) creates new thread, and if main thread exits, why should the new thread too exit? both are different entities, The same doesn't happen if the child thread exits, the parent thread would be alive.
View 1 Replies View RelatedI am running Fedora 12 with clean install. last updated 1/8/10 AM.Trying to install chkrootkit I get the following when running "make sense":
gcc -DHAVE_LASTLOG_H -o chklastlog chklastlog.c
gcc -DHAVE_LASTLOG_H -o chkwtmp chkwtmp.c
chkwtmp.c: In function �main�:
chkwtmp.c:95: warning: incompatible implicit declaration of built-in function �exit�
[code]....
I am using Pthread concept for developing my application Some times my system is getting hanged while the code is running and as soon as I am Pressing CTRL + C it is coming out of the code and system is going to the normal state. but several time only ^C is appearing in the terminal and system is not responding. do any one have the Solution what to do in that case.
View 3 Replies View Relatedusing 'ntfs-config' to make ntfs partitions mount on bootup so that I can access my data partition from Ubuntu. The first time I installed ntfs-config it would not run. I uninstalled and reinstalled it and then it ran, but it didn't seem to be responding very well. I attempted to tick the partition I wanted and set it to be writeable. After I closed the app ALL my ntfs partitions were mounted, even the windows and system reserved partitions, and when I attempted to unmount them I got the following error:
Unable to unmount Data
Error unmounting: unmount exited with exit code 1:
helper failed with
unmount /dev/mapper/isw_dfjjdefcdi_RAID5p4 is not mounted (according to mtab)
I tried rebooting. I tried uninstalling ntfs-config, then reinstalling it (now it wont run again). So I'm at a loss as to what to do. I simply want my data partition mounted on boot up and writable, not the others.
I learn C++ reading the <C++ primer 4th>, question1.2 let me test if return -1 how the compiler handle this exit code.
and in gcc (GCC) 4.1.1 20070105 (Red Hat 4.1.1-52), I get this show:
[youxi600@Arthas C++ Primer]$ cat q1_2.cpp
int main()
{
return -1;
}
[youxi600@Arthas C++ Primer]$ gcc q1_2.cpp -o q1_2
[youxi600@Arthas C++ Primer]$ ./q1_2
[youxi600@Arthas C++ Primer]$ echo $?
255
[youxi600@Arthas C++ Primer]$
anyone can give me an advise? Many thanks!
I'm investigating how to copy a file located in my file system into another device. I googled to find a solution for my case but I didn't find anything. My original problem was to find a way to permit my code to move a file into a USB device. I wonder If is there a way to implement the cp command or some mechanism that permits my code to interact with between the file system on my computer and the second one on USB external driver (FAT32) ?
View 3 Replies View RelatedI have been running a live version on a 8 gig stick. Played nice for a couple of months but now when I try to access the native ntfs file system, I get the following error message.... Error mounting: mount exited with exit code 21: mount: according to mtab, /dev/sda6 is already mounted on /media/c
View 1 Replies View RelatedMy computer has been acting quite strange lately. It's been taking longer to boot, and my sound doesn't play anymore (Only a high pitched sound is heard, and no hardware for sound is detected). Just recently, my Windows 7 Partition returned the error of Disk Error Occured. Press CTRL+ALT+DEL to restart.
Any way I can fix my whole issue, I think my desktop is starting to die on me :O (And its only about 7 months old T_T)
my windows xp system has recently been messed up, everytime i boot, i see the windows logo and then it reboots so i decided to liveboot ubuntu in order to recover the important files on my hard drive and then reboot. Problem is when i try to click on my "500GB Filesystem" I get this message.Unable to mount 500GB FilesystemError mounting: mount exited with code 13:ntfs_attr_pread_i:ntfs_pread failed:/input/output error Failed to read NTFS $Bitmap:Input/output error NTFS is either inconsistent, or there is a hardware fault, or it's a SoftRAID/FakeRAID hardware. In the first case run chkdsk/f on Windows then reboot into Windows twice.The usage of the /f parameter is very important! If the device is SoftRAID/FakeRAID then first activate it and mount a different device under the /dev/mapper/directory(e.g./dev/mapper/nividia_eahaabcc1). Please see the 'dmraid' documentationfor more details
View 1 Replies View RelatedCode:
#include <iostream>
using namespace std;
[code]...
I am doing some Linux kernel programming for my research project. I need to record the timestamp (by using cpuid and rdtsc) when an interrupt handler (top half) is first invoked. Due to the time critical nature of the problem itself, I have to do the timestamping inside the interrupt handler itself (the first operation when the handler is called). However, I understand that tasks that are not so time critical should be deferred to a tasklet function (bottom half) for processing because other interrupts are disabled in a (top-half) interrupt handler. I am currently out of idea on how I can pass the timestamp information that I have obtained in the interrupt handler to the corresponding tasklet function.
View 2 Replies View RelatedMy system has stopped to boot at all...
Code: Select alldone.
Setting parameters of disc: (none).
Setting preliminary keymap...done.
Activating swap...done.
Checking root file system...fsck from util-linux-ng 2.17.2
[Code] ....
An automatic file system check (fsck) of the root filesystem failed. A manual fsck must be performed, then the system restarted. The fsck should be performed in maintenance mode with the root filesystem mounted in read-only mode. ... failed!
The root filesystem is currently mounted in read-only mode. A maintenance shell will now be started. After performing system maintenance, press CONTROL-D to terminate the maintenance shell and restart the system. ... (warning).
Give root password for maintenance
(or type Control-D to continue): _
For now, I just don't know what I should to do next to my system has started to work again...
i am trying to install ubuntu from an SD card, i can run it from the card, and everything works fine, all but the install. i get to step 3 of 6. when pressing forward i get an error message ubiquity.components.partman failed exit code 141
View 1 Replies View RelatedI am re-installing Ubuntu onto my desktop PC which has Windows 7, openSUSE 11.2 and Fedora Core 12. First I tried Ubuntu 9.10. Near the end of the installation the machine reboots and the monitor shows the following message:
"Ubiquity.components.partman failed - Exit code 10. Further info in /var/log/syslog"
Tried again with Ubuntu 10.04 beta2 with same problem.
How can I view and read /var/log/syslog if Ubuntu fails to be installed and therefore I cannot access this log?
When i open project in code blocks and click build and run, it pop out debug report and exit after that
View 3 Replies View RelatedAccidentally the usb plug on my WD "My Book" got halfway unplugged and I didn't notice it. when I rebooted it, it wouldn't read the drive. I tried using G Parted to repair it but no success, it just runs forever accessing the drive and never finishes. (I left it running an entire weekend and it didn't finish) the drive is formated ext3.
When I try to mount the drive in Ubuntu 9.10 it gives this error message:
Strangely if I boot into Windows and use the ext driver I can access the drive just fine. is this something I can fix? if needed I can use Windows to do any repairs.
I get the following message when trying to access my 1tb usb drive "Error mounting: mount exited with exit code 1: helper failed with: Error opening '/dev/sdr1': Permission denied Failed to mount '/dev/sdr1': Permission denied Please check '/dev/sdr1' and the ntfs-3g binary permissions, and the mounting user ID.More explanation is provided at [URL].. Really wierd thing is Linux Mint Debian reads it just fine
View 1 Replies View RelatedI slipped on my expansion drive cable and it disconnected quickly, when I reconnected I got this error: Error mounting: mount exited with exit code 13: $MFTMirr does not match $MFT (record 0). Failed to mount '/dev/sdb1': Input/output error NTFS is either inconsistent, or there is a hardware fault, or it's a SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows then reboot into Windows twice. The usage of the /f parameter is very important! If the device is a SoftRAID/FakeRAID then first activate it and mount a different device under the /dev/mapper/ directory, (e.g. /dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation for more details.
View 1 Replies View RelatedWhat is the real difference between system calls and normal function calls. Ultimately function calls too would be passed to kernel for some or the other work.
View 7 Replies View Relatedwhen i call the "system()" function from my C program everything works well, but when i try to call it from a cgi C program it doesn't work. the server log tells me this is a permission error.i have chmod'ed 755 the cgi program but it still does not work.
View 5 Replies View RelatedI need to rewrite the selenium java code into its equivalent php code.
View 5 Replies View RelatedI want to declare a function in a function, but had no success till now, see the error code below and visit the project at sourceforge
[Code]...
It seems I cannot mount and unmount a USB Drive, it gives me the following error:
Error mounting: mount exited with exit code 1: helper failed with: mount: only root can mount /dev/sdb1 on /media/DAVE-1
I have changed FSTAB, and now it looks like this:
proc/procprocdefaults00
sysfs/syssysfsnoauto00
usbfs /proc/bus/usb usbfs auto,user 00
devpts/dev/ptsdevptsmode=0620,gid=500
code....