Programming :: Standard For Naming Convention Of Commandline Options
Feb 22, 2011Is there any document or specification like the Linux Standard Base for the naming convention of commandline options?
View 3 RepliesIs there any document or specification like the Linux Standard Base for the naming convention of commandline options?
View 3 RepliesWhat's most commonly used and what do you prefer? C-Style (this_is_my_function), Camelcase 1 (thisIsMyFunction), Camelcase 2 (ThisIsMyFunction
View 10 Replies View RelatedI just installed Fedora 12 and grub is not working for me. I have 2 physical drives, and installed Fedora on sdb (win xp is on sda). I picked the option that the computer booted from sdb when I installed. I then went and switched the boot order in the bios so that the computer would boot from sdb. Now Fedora boots fine, but when I try to boot into windows I just get a blinking cursor. I tried booting to windows manually (via picking that drive from the bios options) and that works fine.
I tried to edit grub.conf, but wasn't sure how to address the appropriate hard drive. How do I know what to fill in? The linux drive is (hd0,0), and grub tried to make windows (hd1,0). How do I know what to put in (hdx,y) for the windows partition? Grub tells me I have a /boot partition so everything is relative to that.If I'm way off base, please let me know. Is there a way I can just re-run grub so that it looks for everything anew? I also looked at device.map and sda is hd0.---------- Post added at 02:42 PM CDT ---------- Previous post was at 02:37 PM CDT ----------If it helps, this is my grub.conf:
Code:
# grub.conf generated by anaconda
#
[code]....
Where would i find the list of distribution codes.For example.Code:samba-32bit-3.4.2 -1.1.3.1.x8664.rpmIn above rpm file it is indicated that its release is 1.1.3.1 .The rpm is meant to be run for opensuse.Where would i get the linking of release number and In simple words How would i guess distribution by merely looking at rpm name?
View 2 Replies View RelatedSome programs will take options like this:$ someprogram -orange apple
And other programs will use something like this:
$ otherprogram --orange apple
Is there a "rule" or convention for this in Linux/Unix/OSX?
While writing pseudocode is there a convention for writing comments within the pseudocode?
View 4 Replies View RelatedI have images in jpg format
Code:
CIMG0100.jpg
...
...
CIMG0131.jpg
I used imagemagick to convert the files to gif with the following command
Code:
for i in {100..131}; do convert CIMG0$i.jpg CIMG0$i.gif; done # works
This worked like expected, but when afterwards I wanted to scale the images
Code:
for i in {100..131}; do convert -scale 25% CIMG00$i.gif CIMG00$i_scaled.gif; done # works not it seems the system is working for about half a minute, but I get no output. The single command
Code:
convert -scale 25% CIMG100.gif CIMG100_scaled.gif # works
works as expected and gives me a scaled image. What does the convert command do in the second case? is the for-loop wrong?
Where is the location of the header files for the c++ standard library?
I assume that they were installed by gnu g++, please correct me if i'm wrong.
I'm running ubuntu 10.04 with g++ 4.4.
I looked in /usr/lib/gcc/i486-linux-gnu/4.4/include, but this directory contains only the following:
Code:
Which doesnt seem to include the really basic things like iostream, for example.
Where can I take a look at the header files for these standard c++ libraries?
I need a way to find all the files not owned by root:root on the commandline. How can this be done?
View 2 Replies View RelatedIs it possible to do the following in C/C++ in Linux:Without direct linking (my program should NOT depend on Qt or GTK), display a GTK or Qt based file dialog.The behaviour should be something like this when my program runs, when you want to open a file:The program scans whether you have Qt installed. If so, it somehow manages to link itself to Qt (e.g. dynamically loading the .so file) and display its file dialog and get the path from it. If Qt wasn't found, it tries the same with GTK. If that also wasn't found, it displays a less powerful replacement dialog instead (better than nothing).
Or is there any other simple way in Linux to get a standard file dialog somehow (similar to when compiling for Windows you can very easily get its standard file dialog, no matter what version of Windows, in your code, even if your program doesn't use any other Windows GUI at all).
I am making a program to reverse a string
Code:
#include<stdio.h>
int main ()
{
int i,j;
[Code].....
I have a data in a column.
Code:
I want to calculate average and standard deviation. As first step I want to calculate average for the data than calculate (del=data - avg) for all the data.
I suppose get
Code:
For this I use AWK and the code goes like this
Code:
But I get different answers.
Code:
Why the answers are so different? since this is wrong I can not continue calculating the standard deviation.
I'm trying to pull out sections from a bunch of files. For one file, I use:
Code:
sed '/string1/,/string2/ !d' <filename.ext >newfilename.ext
to pull out everything between two strings in the original file and put them in a new file.
[code]....
I have created two threads:
Thread 1 and thread 2
In the main thread, i have put up a timer which generates a signal periodically when it expires, which reults in execution going to signal catcher function.when this function is invoked, under certain condition it goes to thread 1 and under another condition it goes to thread 2. The problem lies here that when it goes to thread2,i have a loop to process but it doesnt come out of the loop and hence from thread2, even though timer has expired.
The code is attached..My intention is that getchar which usually blocks,should come out after 5 seconds(VTIME).But this is not happening..can anyone tell me the mistake that I make..?
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
[code]...
From cat.c in GNU coreutils:
Code:
void
usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.
[Code]...
I don't remember ever seeing this in any examples I've ever seen, so I'm sure I've never seen an explanation of this.
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?
If /mnt & /media are for temporary mount points and removable drives, what is the usual convention for locating permanently mounted partitions for all users on the computer? e.g. I have a partition for photographs, I'll just call it "photos" would it be bad form to mount it as /photos or something like /my_hdd/photos ?In practice it probably won't matter, but I want to make sure it's easy for anyone else to perform admin tasks on the computer when I'm not available.
View 2 Replies View RelatedI am trying to build an application that must link with python so as to load a python module during runtime.I have this makefile :
Code:
[alex@iskandhar src]$ cat Makefile
CFLAGS = -Wall -O3 -I ../../../SPOOLES.2.2 -DARCH="Linux" -DSPOOLES -DARPACK
[code]....
I want to be able to use multiple options at the same time and some of those options will require an argument and some will not.
Here is my bash script:
#!/bin/bash
while getopts ":a:bc:de:fg:" opt ; do
case $opt in
a)
[Code]....
If I only use option -a with no arguments, the script works...
I'm trying to compile and run a java application on Ubuntu 10.04. In the run drop down there are no run options in "run as". I have PDE installed but for some reason its still does not work.
View 1 Replies View RelatedWe make everyday a DB Mysql backup on Linux redhat Enterprise. We are using a bash shell script (and putting it in the crontab) to execute it automatically everyday. We added a line to this script telling, once the backup has completed, to find old backup files (stored on hard disk after each backup) older than x days to remove them. We use the find command (search for file type) with the mtime option and in combination with rm command. Everything runs ok but we also want to add some new code to the same line: If find command cannot find anything or fails, for example if it cannot delete file or fails, send the error message (standard error output) to an error file (like error000001 and increasing) and mail the errorxxxx file to an email address for example to admin@companyname.com. What would be the code for this issue to add it to our find command in the same bash shell script??
View 2 Replies View RelatedCode:
Andrew@Mac:~$ g++ -march=athlon64-sse3 -O2 Projects/omgarrays.cpp -o Desktop/omg
Projects/omgarrays.cpp:1: error: bad value (athlon64-sse3) for -march= switch
[code]....
All day I have to connect to various unix servers via ssh or ovpn. These servers report the current ip hourly to our dns server. I am trying to minimize the few hundred times a day i type ssh myUN@xy1234.mydns etc to connect. 1234 being a store number.
I would like to create a login script that has 2 options. -o = ovpn and -s= ssh. Is this possible.
ssh muUN@xy____.mydns is always used for ssh.
openvpn --remote xy_____.mydns --config client.ovpn is always used for ovpn.
I would like to be able to type something like,
[jim@localhost tools]$ ./login -? 1234
again 1234 being the store number I need to connect to.
How can I disable structure alignment feature of gcc using command-line options ?I recently migrated to 64-bit OS, and doubt that I might be experiencing a structure alignment problem due to the new 64-bit architecture.I checked the sizes of the same C-style struct in both x86 and x86_64, and found out that they appear to be different by 20 bytes.I am not sure if this is due to structure alignment or the differences in data type lengths between two platforms.Hence, I will first disable the structure alignment feature, and then check the struct sizes again.
View 3 Replies View RelatedI thought about this a while ago when reading through a Python tutorial and I googled some and couldn't find an answer. Now I want to know it for Ruby, also, and it's more important now because I want to invoke Ruby with -w.
How can you use:
Code:
with a -w option to ruby, like:
Code:
This doesn't work and I can't find an explanation of how to do it.
Code:
How can I make radiolist dialog which content so many options what is the value of the variable?Quote:
echo "How many options?"
read=VAR
dialog --title "sdf" --backtitle "sdff" --radiolist "ffdsfsd" 15 60 5 "1" "first" on "2" "second" off "3" "third" off "4" "fourth" off etc..
I must explode dialog in loop and add options? or something like that?
What is "--installdirs site" options in cpan configuration?
View 1 Replies View RelatedI usually use wget to download stuff from websites when scripting.I have a new requirement that requires me to authenticate then select some options to execute the download. How would I go about this? First thing that comes to mind is using keyboard macros in the Windoz world but I need to do this in bash or perl.
View 1 Replies View RelatedAnyone else using the Mill Hill & Canterbury (MHC) Modula-2 to Java compiler?
[URL]
I cannot access the command line options and the environment variables.