General :: Passing Options To A Program: What's The Convention For One Dash Vs Two?

Mar 20, 2011

Some 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?

View 2 Replies


ADVERTISEMENT

Programming :: Standard For Naming Convention Of Commandline Options

Feb 22, 2011

Is there any document or specification like the Linux Standard Base for the naming convention of commandline options?

View 3 Replies View Related

General :: Passing Program Arguments To Gdb?

Nov 18, 2009

I'm using gdb to debug my program. My program requires arguments (e.g., ./prog -dfile).But if I use gdb as in gdb ./prog -dfile, gdb wants to interpret the -d argument. How do I pass an argument to my program via gdb?

View 2 Replies View Related

Ubuntu Servers :: Passing Mount Options To Autofs5 Via Init Script?

May 7, 2010

At work we use autofs4, and we also take advangate of the -DOSNMAE=blah and -DOSREL=blah for our automount maps. We're moving some systems to autofs5 and I can't for the life of me figure out how to pass these options properly. There's no 'localoptions' in the init script anymore as there was for autofs4. I've tried adding the flags to the OPTIONS variable in /etc/default/autofs. That adds them to the global autofs process but then nothing in the automounter mounts.

View 3 Replies View Related

General :: Possible To Install Program With Options?

Mar 8, 2011

I want to install squid with the options --enable-storeio=null. I am using Ubuntu Server 10.10. Can I install squid using apt-get with options or use another package manager?

View 1 Replies View Related

Programming :: Passing Input To Program For Test

Apr 13, 2011

I started to run a C++ my program in Linux and I don't know how to test my program that works fine with a text file. This is a project for my uni and to explain more clear, My program is a sample database for modify or add and search and it read data from a binary file and also write into a binary file. I have got an input from my lecture and she said after compiling in Linux I must write:

1-to compile:
Code:
g++ (files with cpp)
2-to see the output:
Code:
./a.out
3-to test with input:
Code:
./a.out < input.txt >

My problem is in step three. What I must write in the command part after" step2" to see the output?

View 3 Replies View Related

Programming :: Passing Another Program A Password And Username?

May 14, 2010

Are there any security implications in passing a binary unix program a username and password via variables from within a script ?

View 14 Replies View Related

General :: Rpm Naming Convention \ Find The List Of Distribution Codes?

Mar 17, 2011

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 Related

General :: Why Does Md5sum Return A Dash At The End

Apr 19, 2011

why does md5sum return a dash at the end:

Code:
$ md5sum
string290350295 -

How can I remove this using the md5sum tags?

View 2 Replies View Related

Debian :: Default Configure Options For A Program?

Dec 28, 2010

Can I find somewhere the default ./configure options that Debian uses when compiling packages? For e.g. I would like to know these options used for compiling Midnight Commander...

Are there any default ones and where to look at them?

View 1 Replies View Related

General :: BASH/Dash : Put A JPEG Or PNG Into The Clipboard?

Dec 5, 2010

copy a jpeg or a png and place it into the clipboard of X11 of my icewm. which program can do cat "myfile.jpg" > ?theclipboardofx11?

View 10 Replies View Related

Programming :: Using Command-line Options With A Program That's Called Using Env

Oct 11, 2010

I 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:

View 1 Replies View Related

Ubuntu Multimedia :: Program To Download In Order To Get Options As One Does From Properties In Windows 7?

Apr 7, 2011

In Windows 7, the options are pretty nice - ability to change track name, artist, composer, album, song number in album, etc., all from "Properties." In Ubuntu 10.10, Properties really gives you the bare minimum. Is there a program to download in order to get the same sort of basic options as one does from Properties in Windows 7?

View 4 Replies View Related

Programming :: Is There Pseudocode Comment Convention?

Nov 18, 2010

While writing pseudocode is there a convention for writing comments within the pseudocode?

View 4 Replies View Related

Programming :: C - Finding About Function Naming Convention

Feb 13, 2010

What'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 Related

Fedora :: Convention For Permanent Partition Mount Points?

Aug 24, 2009

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 Related

Fedora Installation :: Hard Drive Naming Convention?

Mar 23, 2010

I 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]....

View 7 Replies View Related

General :: Passing One Variable To Another

Jan 8, 2011

I am new to bash scripting. I want to know whether i can pass one variable to another. For example $1 represent argument1. Now if i want to get the argument 1 like USER="1" now i want $ of $USER to execute $1 so what should i do..

View 2 Replies View Related

General :: Passing PATH Through Sudo?

Jan 21, 2010

In short: how to make sudo not to flush PATH everytime?

I have some websites deployed on my server (Debian testing) written with Ruby on Rails. I use Mongrel+Nginx to host them, but there is one problem that comes when I need to restart Mongrel (e.g. after making some changes).

All sites are checked in VCS (git, but it is not important) and have owner and group set to my user, whereas Mongrel runs under the, huh, mongrel user that is severely restricted in it's rights. So Mongrel must be started under root (it can automatically change UID) or mongrel.

To manage mongrel I use mongrel_cluster gem because it allows starting or stopping any amount of Mongrel servers with just one command. But it needs the directory /var/lib/gems/1.8/bin to be in PATH: this is not enough to start it with absolute path.

Modifying PATH in root .bashrc changed nothing, tweaking sudo's env_reset and env_keep didn't either.

So the question: how to add a directory to PATH or keep user's PATH in sudo?

Update: some examples

$ env | grep PATH
PATH=/usr/local/bin:/usr/bin:/bin:/usr/games:/var/lib/gems/1.8/bin
$ sudo cat /etc/sudoers | egrep -v '^$|^#'
Defaults env_keep = "PATH"

[Code]....

View 4 Replies View Related

General :: Passing A Structure In A Socket?

Mar 31, 2011

So I'm trying to teach myself to write programs for unix in c. I am currently creating a program, and I need to pass a struct through a socket

The struct I want to pass has two types in it, one enum and one union of two other structs. These two other structs each contain an int and a char variablename[256] array.

gcc won't let me just pass the struct using write(pipefd[1], struct, size_of_struct) since the struct is not a char buffer. So that's my question...how does one go about passing a struct?

View 1 Replies View Related

General :: Passing Parameters To Script ?

Mar 13, 2010

I have the following bash script:

Code:

Which has the name 'extractemails.sh' and works just fine.

However, i whish to be able to give the url (or any other url) as a parameter when i run the script like this: $ extractemails.sh [url]

What should i change in my code? i have never tried passing parameters to scripts before.

View 4 Replies View Related

General :: Bash - Passing Commands To CLI Using A Script

Jul 31, 2011

is there any way I can pass commands to the CLI of a tool directly?

I would like to script some actions, for example:

./OpenBTS < "tmsis"

I do not need to retrieve the results (I watch it in the log file). how I could realize that? There is now way to do this using command line parameters, at least not that I found out. So it looks like I have to figure out sth myself. Maybe I could automate screen in a way to detect the prompt and "paste" my command there. Are there tools for this on Linux?

View 3 Replies View Related

General :: Passing SSH A Password Through Command Line?

Aug 4, 2010

I am writing a script to get hardware information of a particular UNIX machine. To do this, I ftp a shell script (commands to get h/w information) to the target machine and then use SSH to remote the remote script.With FTP, I can pass a password accepted as input the shell script. How can I pass the same password to SSH ? This is because I do not want the user to enter the password twice.

View 5 Replies View Related

General :: Passing A List Of Variables To A For Loop

Mar 17, 2011

I'm trying to do substitutions to a file based on passed variables.

For example, I have a file called test.txt that has 5 lines:

What I want to do is to go through that file, line by line and check for the presence of a passed variable in that line. If I have a match, then substitute and print, otherwise print line as is. My problem arises in that the number of variables is well, variable.

The code I started with was the following:

Code:

What I was hoping for was test.out to look like this:

What I get is a much longer file like this:

This makes sense after thinking about it but is there anyway to get an output like the first case?

View 5 Replies View Related

General :: Passing An Array As Command Line Arguments?

Apr 2, 2011

how to pass an array as a command line argument in a shell script?

View 5 Replies View Related

General :: Passing Multiple Arguments In Shell Script?

Dec 11, 2010

The script receives multiple files as parameters and it is supposed to count the number of lines in each of them and write that number in another file.

This is my script:

Code:

while [ -n "$1" ]
do
lines=`cat $1 | wc -l`
echo "The number of lines in file $1 is $lines." >> lines.txt
shift
done

Is there any other way to do the same thing, without using shift?

View 7 Replies View Related

General :: Scripting - Try To Passing Arguments To For Cycle - Inside A Function

Apr 26, 2011

The code:

Quote:

Problem: I need a method to maintain the $i variable. In fact, actually, this variable get lost when executed. I think that an escape can preserve this variable and permit its execution inside the function, but I've no idea about.

View 3 Replies View Related

General :: Passing Commands As Arguments To Functions In Bash Script?

May 31, 2010

I wrote a simple bash script to let me treat any set of programs like a deamon. For example if I configure the script a certain way I can start/stop/get the status of apache, mysql and php all from one command. I am having a bit of a problem though. I am passing commands as strings to a function and then depending on the arguments to the script it might run one of these commands or another. Some of these commands need to beun in the background though, such as deluge-web. When I send "deluge-web &" to the function and it execute it deluge-web does not start in the background. I can't figure out why this is. I have tried escaping the & with ''s and with a , but nothing seems to work. I know that this is some idiotic thing that I am overlooking, but I am a bit stumped. Here is the script configured to start/stop/get status of deluged and deluge-web.

Code:
#!/bin/bash
function checkanddosomething {

[code]...

View 3 Replies View Related

Programming :: Parameter Passing: Parameters In General Info Requested

Apr 26, 2010

Ive read a few books and a lot of tutorials on C but can't find this topic explained in a deliberate way.I can find bits and pieces but nothing thorough.

View 9 Replies View Related

Ubuntu Installation :: Installer Options - Can't Select Any Of The Menu Options Except For Boot From First Hard Drive

Mar 19, 2010

So I have the burned ubuntu CD, and I'm attempting to install it on a system that has one HDD with XP/Vista on it, and another that is completely formatted and unpartitioned. However, when I boot to the ubuntu CD, I can use the menus from the bottom, and select the language when initially prompted, but I can't select any of the menu options except for boot from first hard drive.

View 1 Replies View Related







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