General :: System Call (not Bash Command) To Format Partition?

Feb 18, 2011

I'm working on Linux OS (Suse/redhat) and trying to format a linux partition from a c program. Is there a way to do this without using : 'system ("mkfs.ext4 /dev/sdxy")'

View 4 Replies


ADVERTISEMENT

Software :: Script That Call A Java Program That Call A System Command?

Nov 29, 2010

In practice I have a script that call a java program that call a linux system command. The script if I run it, from a shell functions well,so it is not a java problem. The problem come out when i put this script in a crontab schedulation. The result in this case is that java do not execute the system command. I think it depends on crontab

View 4 Replies View Related

Ubuntu :: Javascript To Call Bash Command

Sep 21, 2010

First, i have no experience with javascript. I came across an interesting site and I'm curious if I could make a private webpage to call some shell commands or just open a terminal.Yes, i know this could potentially be malicious and possibly illegal. Again it's for my own private usage.

View 1 Replies View Related

Programming :: Bash - Use The Call Command (displays The Current Month And The Next Month)?

Mar 8, 2011

how i can use the cal command so it displays the current month and the next month, i know you can use cal -3 9 2007 to show the previous current and next but i just want to display the current and next.

View 9 Replies View Related

General :: Call Another Bash Script To Run On A Subfolder?

Sep 29, 2010

I want my bash script to run scripts located on a different folder. If it is also located on the same folder with my script, it will go like this:

on my $HOME folder: (this_script.sh, backup.sh, restore.sh, purge.sh)
#!/bin/bash
./backup.sh
./restore.sh
./purge.sh

But what if, on my $HOME folder: (this_script.sh)

$HOME/scripts folder: ( backup.sh,restore.sh, purge.sh )

Below doesn't work...

#!/bin/bash
./$HOME/scripts/backup.sh

View 5 Replies View Related

General :: Cd Dirname - Use The Output Of A Nested Bash Builtin Call

May 2, 2011

I'm trying to remember how to use the output of a nested Bash builtin call. So `which prog` gives me the path to the program, i'm interested in. Then I would like to get the directory path leading to that program and plug it into 'cd', so i end up in the directory containing the program.

View 5 Replies View Related

General :: How To Call Certain Command Info

Oct 13, 2010

When I an in Emacs, I want to call info pages like in terminal. E.g., info date will call the date info page, but when I in Emacs, I can only use M-x info call the complete info pages, but I only want to see the date info page. Then which command I should execute in emacs.

View 4 Replies View Related

General :: Format Master LUKS Partition With/without Damaging Other Partition?

May 11, 2010

I need to change my LUKS partition to NTFS as I do not need the boot partition any longer, but I need to keep sdb3 (truecrypted ext3) intact. This is how the disk looks now:

Code:

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

[code]....

View 2 Replies View Related

General :: Want To Format Bash Errors

Jun 8, 2011

I am using Fedora 14 and when I am executing a file:

#!/bin/bash
asd #assuming this command does not exist

I am getting following error:
/path/to/file: line 2: asd: command not found

I want to format it so it outputs error in same way as it would when it was executed from terminal:

$ asd
bash: asd: command not found

View 1 Replies View Related

General :: Write A Literal Bash Command In A Bash File?

Nov 29, 2010

I create a bash script that writes another bash file. But in the generated bash file I want to write a bash command in the file and not executing it.Here's my bash file:

Code:
#!/bin/bash
cat > ~/generateGridmix2data.sh << END

[code]...

View 6 Replies View Related

General :: What Is Signal0 In System Call

Sep 28, 2010

what is what is signal 0 in linux system call ?i can't find that in kill -l signal list . i need to know what is signal 0 . * for examples signal 1 is SIGHUP and signal 2 is SIGINIT . what is signal 0 ?

View 1 Replies View Related

General :: The READ System Call In UNIX?

Oct 29, 2010

mplement the read system call in unix...i want the code for read system call...

View 6 Replies View Related

General :: Error While Adding The New System Call?

Jun 9, 2011

I have added a new system call for kernel version Linux 2.6.25-14.fc9.i686. after kernel compilation and running the user mode program i am getting the below error

Error :: Function not implemented
Error number 29

I cannot find the syscall_table.S or entry.S file in the source code , so i didn't made the entry of the syscall in this file, how much necessary the entry of syscall presence in this list and how to get this file?

View 1 Replies View Related

General :: System Call To Know Files And Directories In PWD

Mar 3, 2010

I am searching for any system call similar to "ls" command we use in shell. My requirement is knowing the files and directories in curent working directory and process them based on there type. Here as of now I spawn another procees with system command like system
("sh ls -l | grep ^d | awk '{print $9}'").

Instead of this I want to use any system command where I can capture this information directly into my local character buffer. My opinion is that system calls will not spawn another process as a result less time it takes, another reason is once I use the system command again I need to capture the information to a local file then again read it into local buffer. I want to avoid the file manipulation here.

View 1 Replies View Related

General :: Bash Script To Convert MPG Files To AVI Format?

Sep 19, 2009

I'd like to write a bash script to convert all of the .mpg files in a directory to .avi files. The ffmpeg part of this produces the kind of file that I want, but rather than changing the name of the input and output files each time that I run the script, I'd like to automate it. I've tried this script, but I get an error "command not found".

#!/bin/bash
cd /home/michael_s/golf_temp
1 for i in 'ls *.mpg' ; do
/usr/bin/ffmpeg.exe -i /home/michael_s/golf_temp/"$i" -map 0:0 -map 0:1 -pass 1 -vcodec mpeg4 -vtag xvid -f avi -b 1100k -vol 384 -mbd rd -s 640x480 -aspect 4:3 -acodec libmp3lame -ac 2 -ab 128k /home/michael_s/golf_temp/"$i".avi

rm -f /home/michael_s/golf/temp/"$i".avi
/usr/bin/ffmpeg.exe -i /home/michael_s/golf_temp/"$i" -map 0:0 -map 0:1 -pass 2 -vcodec mpeg4 -vtag xvid -f avi -b 1100k -vol 384 -mbd rd -s 640x480 -aspect 4:3 -acodec libmp3lame -ac 2 -ab 128k /home/michael_s/golf_temp/"$i".avi
done
fi
quit

View 5 Replies View Related

Programming :: Assigning Bash Variable With The System Command In Awk?

Mar 1, 2011

I am having all sorts of trouble trying to assign a variable within an awk script with the system command. I know there is a lot of ways around this problem, but for efficiency reasons, I would like to, within my awk script, do something like

system(x=3)

or

system(x=NR)

and, latter on the shell script which calls the awk script, use the variable $x. But nothing is passed to x. I have already tried things like

command = "x=3"
system(command)

and also used a pipeline within the system to pipe it to /bin/sh In fact tried a lot of stuff like that, using $(( )) etc etc etc I can create directories e write to files (yes, i could write to a file and read from there, but I dont think it is efficient, plus I am puzzled).

View 7 Replies View Related

General :: How To Determin Function Call When Application Run On System

Sep 6, 2010

How can it be determined whether a function defined in some file of an application source-code(meant for multiple operating systems e.g., Linux, AmigaOS) is actually called when the application run on Linux?

View 9 Replies View Related

General :: Access Driver Function Using System Call ?

Apr 13, 2010

As per my knowledge, one can use systemcall to call the driver functions for example using open, close... Now is there any way to call driver functions directly from application without using system call?

View 4 Replies View Related

Programming :: Parsing VoIP Call Detail Records (Field Format)

Jan 4, 2010

I am going to parse the Cisco voip CDR(Call Detail Records), please tell me the field format of the CDR files.

View 1 Replies View Related

Ubuntu :: Put Icon In The System Tray And Run Bash Command When Clicked?

Jul 29, 2010

I am trying to find a way to put an icon in the system tray and run a bash command every time I click on the icon.

Purpose: I want to set up a system tray icon that will hide/unhide the desktop when clicked, much as would the standard desktop panel plugin for the various panel apps like lxpanel, gnome panel, etc.

Why don't I just use a panel app?

I am using a very reduced install of Ubuntu Lucid oriented towards first time PC users on very old hardware, using Openbox as the window manager and Tint2 with lxlauncher instead of a panel, the latter both compiled from latest source for some slight customization. Tint2 is a taskbar that also features a built in clock applet and system tray which I have chosen after examining basically all other alternatives and chosen for its light footprint and customization. It gives me everything I need except a single click hide/show-desktop feature or a halt/reboot/logout menu. lxlauncher is a very lightweight alternative to the Ubuntu Netbook Remix netbook-launcher (and/or netbook-launcher-efl) package that conforms to the freedesk specifications and occupies all free deskspace other than tint2, under all other windows. I used the freedesk specs to set up a "shutdown" menu category and created shutdown.desktop reboot.desktop and logout.desktop files in the category to add that feature, using dbus commands for the first two and 'openbox --exit' for the latter.

I set the openbox config to open all app windows maximized with no decoration, so each app takes up the whole screen other than tint2 and can only be closed by right clicking on its icon in tint2 or by its file->Quit menu.

This gives me a kind of OLPC for grown ups with no computer experience. In other words, for people who don't know what a desktop or window is. This is similar to the Ubuntu Netbook Remix except that in UNR they superimpose the window decorations over the gnome panel so you can still close the window.

However, the one problem here is that to see lxlauncher when one has several apps running, one has to click on each app in tint2 to minimize it. I would like to add a system tray icon to make this possible with one click without adding too much more overhead to the existing setup.

Here is a screen cap of the desktop:

BTW, I will use wmctrl to test the desktop visibility state and toggle it using this bash command: test 'wmctrl -m | grep ON' && wmctrl -k on || wmctrl -k off

how to get an icon in the system tray and run the above command when clicked will be appreciated

P.S. I've looked at 'zenity --notification --listen' but running a command when the icon is clicked in this case is a pending feature for the app and not yet implemented. My last resort will be to learn C and try that.

View 2 Replies View Related

General :: Assign IPV6 Address Using IOCTL System Call?

Jul 22, 2011

Please send me the code how to assign ipv6 address using ioctl system call using C.

View 1 Replies View Related

General :: Reboot(LINUX_REBOOT_CMD_RESTART) - Lock Up The System And Does Not Return From The Call?

Jul 8, 2011

I am running an embedded Linux Release 2.4.19-uc0.

I have code in several places that calls

reboot(LINUX_REBOOT_CMD_RESTART)

successfully. I need to put it into a new place in a application running on the system. When I do, it seems to just lock up the system and does not return from the call nor leave me able to Telnet in or Ping or anything. I've tried puttingtrace code in to write info out to a file, but that too is not working (as it never returns from the reboot() call.I don't get any error from reboot(), it just does not return and does not appear to restart the system.

View 3 Replies View Related

Programming :: Write A Bash Script Program In System Command Terminal?

Mar 22, 2010

I'm trying to write a bash script program in the Linux command terminal that will write to a fellow user and then continue reading down the program. this is what i have (kind of explains the idea too):

#!/bin/sh

clear
echo "this is before the write command"
write jcummins
this message should go to jerry
echo "the message didn't send and this string will not appear"
echo "it appears it has stopped at the write command"

View 5 Replies View Related

General :: Bash Command History Update Before Execution Of Command

Jun 7, 2010

Bash's command history is great, especially it is useful when adding the history -a command to the COMMAND_PROMPT.However, I'm wondering if there is a way to log the commands to a file as soon as the Return key is pressed, e.g. before starting the command and not on completion of the command (using the COMMAND_PROMPT option would save the command once the prompt is there again).

I read about auditing programs like snoopy and session recorder like script but I thought they're already too complex for the simple question I have. I guess that deactivating that script logs all the output of the command would lead already in the right direction but isn't there a quicker way to solve that probelm?

View 1 Replies View Related

Programming :: Perl About System Command / Fails If The Standard Shell Is Dash And Not Bash?

Jun 30, 2011

I am trying to fix a perl script, and I really suck at perl. But I think this problem will be easy for people who know it.

The problem is, I have an old setup script someone wrote many years ago. It fails if the standard shell is dash and not bash. The only way I've gotten it to work is to point /bin/sh to bash. I looked thru the script and it uses "system" many places, and I think that's the problem.

I searched for it and found this link:url

My plan is to include this function:

Code:
sub system_bash {
my @args = ( "bash", "-c", shift );
system(@args);
}
Then I could simply change all calls to system into system_bash and it should work?

The parameter to the system calls is usually some variable. What if the parameter is a list already? Do I need to test for it somehow, and if it's a list, prepend "bash" and "-c" to the list? How do I do that?

In the script there are lots of places like this:

my $error = system($cmd);
if ($error) {
die/warn "some error message";
}

Shouldn't there be a return in the system_bash function?

View 8 Replies View Related

General :: Can't Recall System App To Call / Test Remote Access To Another Server On Same Network?

Jul 25, 2011

I have logged into one Linux VM and I want to test remote access to another Linux server on the same network but I cannot recall the Linux application to call?

View 10 Replies View Related

General :: What Does This Cryptic Bash Command Mean - Why Command Crashes

Mar 20, 2011

Possible Duplicate: What does this cryptic bash command mean? Why this command crashes Linux? :(){ :|:& };:

View 4 Replies View Related

General :: Command To Delete Bash Command History?

May 31, 2010

What's the command to delete bash command history?

View 4 Replies View Related

General :: Safe To Format Extended Partition?

Aug 6, 2010

My new Debian box is running well and stable enough for me to decide to swipe out WindowsXP altogether. I have a 40GB HDD, which has the following partition scheme (after Windows was removed and hda1 was converted to Linux native type)

Code:
Device Boot Start End Blocks Id System
/dev/hda1 * 1 1762 13313159+ 83 Linux
/dev/hda2 1762 5168 25756889 f W95 Ext'd (LBA)
/dev/hda5 1762 3985 16813408+ b W95 FAT32
/dev/hda6 * 3986 5018 7809448+ 83 Linux
/dev/hda7 5019 5168 1133968+ 82 Linux swap / Solaris

As you can see, my Linux is in the 2nd logical partition hda6 which contained in the extended hda2. The 1st logical partion hda5 is the one I want to erase the data and convert to Linux filesystem in order to have more space. (Yes I can mount it ntfs-3g and use it without any problem, but I just want to say farewell to as many things Microsoft as possible) . What I'm worried about is whether it's safe to do that, without damaging the extented partition which contains the root file system for Debian.

View 3 Replies View Related

General :: Format The Output Of The Ps Command?

Aug 27, 2010

i am running ps xo "pid,command" but I can't find my process in the results. I know that the process is running because I run ps ax | grep command-name

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved