Sponsored Content
Top Forums Programming C++ Beginner Problem With Optget Post 302465722 by JohnGraham on Saturday 23rd of October 2010 09:44:43 PM
Old 10-23-2010
Quote:
$ ./myscript -s 1 -e 8 -c billy -v 1 -o test
Are you sure you're entering "-c billy" and not "-n billy"?

Also, one of your lines:

Code:
if(optarg=="billy")

will result in undefined behaviour. Try changing it to "if (string(optarg)=="billy")" and see what happens.
This User Gave Thanks to JohnGraham For This Post:
 

10 More Discussions You Might Find Interesting

1. Programming

A beginner's problem

Hi, I'm a beginner to study linux program, I know use gcc can link one *.c file to a exe file, but how to link different source files(*.c) to a exe at once. AnyBody know and tell me, thanks. (2 Replies)
Discussion started by: kira_freedom
2 Replies

2. Shell Programming and Scripting

Please help. I am a beginner.

Alrigt, I need to write a shell script where it counts the number of folders and files and dispays "My home directory has 'x' files and 'y' directories." So, I was thinking of doing this. set x = `ls | wc` so, if I have 8 files and folders in my home directory, x is not 8. now, I was... (1 Reply)
Discussion started by: Lykathea Aflame
1 Replies

3. Shell Programming and Scripting

Beginner export problem

Me dumb. Can't get this to work... #!/bin/sh export JAVA_HOME_BAK=${JAVA_HOME} or #!/bin/sh export JAVA_HOME_BAK=/usr/java or #!/bin/sh export JAVA_HOME_BAK=$JAVA_HOME or #!/bin/sh export JAVA_HOME_BAK $JAVA_HOME etc.... none work. Either i get: "JAVA_HOME_BAK=/usr/java: is not... (1 Reply)
Discussion started by: xplodersuv
1 Replies

4. Programming

Beginner C

Anyone know where I can get started in C++ programming in unix? Any good free tutorials or websites to start at? I am okay in unix scripting but have never done c programming of any sort... What are the main advantages of using C++ ? (2 Replies)
Discussion started by: frustrated1
2 Replies

5. UNIX for Dummies Questions & Answers

Beginner Help

hi guys, i have a DEl xps laptop cor 2 duo 2.2 i have vista installed on it i want to install a dual Boot UNIX on it.. can some one guide me ...cause i m tottaly new to UNIX i want to install unix on that laptop along with Vista.... thx any help would be deeply appreciated (sorry if i... (5 Replies)
Discussion started by: Farhan082
5 Replies

6. Shell Programming and Scripting

Beginner Help

I need to write a script to test a nsort c program. I have written 8 .txt files with different cases. Also 8 .txt files with expected outcome. The shell I have written always "test pass" for the first case but always "fail" for the rest... Here is a portion of my code (as I still don't know how to... (5 Replies)
Discussion started by: thibodeau
5 Replies

7. Shell Programming and Scripting

Unknown problem-beginner

Hi, I have a problem running my script.Here it is: num1="1" num2="2" num3="3" num4="4" num5="5" num6="6" num7="7" echo echo "Type what you wanna do..." echo "1= Start interface 2= Stop interface 3= See your mac" echo "4= Change your mac 5= Hack WEP...... 6= Hack WPA...." echo... (3 Replies)
Discussion started by: hakermania
3 Replies

8. UNIX for Dummies Questions & Answers

Beginner - What Should I Do First?

Hi people.... I have just started to learn unix.I want to know which version of Unix to install plus how to install it.I need to practise and make myself aware of how unix works.My thread is from an educational point of view.Also please feel free to give your suggestions as I am... (3 Replies)
Discussion started by: amit.kanade1983
3 Replies

9. Shell Programming and Scripting

Beginner looking for help

Hello, I am trying to write a script that reads names from a file called input, removes names if they have the same letter next to each other and prints the others. e.g. Colin & John would be printed Garry & Lynn would be removed My thinking is that I read in each name and... (3 Replies)
Discussion started by: colinireland
3 Replies

10. Red Hat

Help me please i am beginner

i have windows 8 host on Dell Laptop vmware 9 redhat 7.2 iso downloaded through redhat official site after installation on vm it only boots into text dont show graphics Please guide:( (1 Reply)
Discussion started by: hananabbas
1 Replies
VOS_COPY(1)						       AFS Command Reference						       VOS_COPY(1)

NAME
vos_copy - Make a copy of a volume SYNOPSIS
vos copy [-id] <volume name or ID of source> [-fromserver] <machine name for source> [-frompartition] <partition name for source> [-toname] <volume name for new copy> [-toserver] <machine name for destination> [-topartition] <partition name for destination> [-offline] [-readonly] [-live] [-cell <cell name>] [-noauth] [-localauth] [-verbose] [-encrypt] [-noresolve] [-help] vos cop [-i] <volume name or ID of source> [-froms] <machine name for source> [-fromp] <partition name for source> [-ton] <volume name for new copy> [-tos] <machine name for destination> [-top] <partition name for destination> [-o] [-r] [-li] [-c <cell name>] [-noa] [-lo] [-v] [-e] [-nor] [-h] DESCRIPTION
The vos copy command makes a copy of a volume with a new name. It is equivalent to vos dump followed by vos restore, but doesn't require the volume be stored locally by the client. CAUTIONS
Currently, the maximum size of a volume is 2 terabytes (2^31 bytes). OPTIONS
[-id] <volume name or ID> Specifies either the complete name or volume ID number of a read/write volume. [-fromserver] <machine name for source> Identifies the file server machine where the source volume resides. Provide the machine's IP address or its host name (either fully qualified or using an unambiguous abbreviation). For details, see vos(1). [-frompartition] <partition name for source> Names the partition where the source volume resides. Provide the full partition name (for, example, /vicepa) or one of the abbreviated forms described in vos(1). [-toname] <volume name for new copy> The complete name of the new volume to create. [-toserver] <machine name for destination> Identifies the file server machine to which to copy the volume. Provide the machine's IP address or its host name (either fully qualified or using an unambiguous abbreviation). For details, see vos(1). [-topartition] <partition name for destination> Names the partition to which to copy the volume. Provide the full partition name (for, example, /vicepa) or one of the abbreviated forms described in vos(1). -offline Leaves the new volume flagged as off-line in the volume database. -readonly Flags the new volume as read-only in the volume database. -live Copies the live volume without cloning. This is normally not necessary and causes the volume to be kept locked for longer than the normal copy mechanism. -cell <cell name> Names the cell in which to run the command. Do not combine this argument with the -localauth flag. For more details, see vos(1). -noauth Assigns the unprivileged identity "anonymous" to the issuer. Do not combine this flag with the -localauth flag. For more details, see vos(1). -localauth Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. The vos command interpreter presents it to the Volume Server and Volume Location Server during mutual authentication. Do not combine this flag with the -cell argument or -noauth flag. For more details, see vos(1). -verbose Produces on the standard output stream a detailed trace of the command's execution. If this argument is omitted, only warnings and error messages appear. -encrypt Encrypts the command so that the operation's results are not transmitted across the network in clear text. This option is available in OpenAFS versions 1.4.11 or later and 1.5.60 or later. -noresolve Shows all servers as IP addresses instead of the DNS name. This is very useful when the server address is registered as 127.0.0.1 or when dealing with multi-homed servers. This option is available in OpenAFS versions 1.4.8 or later and 1.5.35 or later. -help Prints the online help for this command. All other valid options are ignored. OUTPUT
This command has no output unless "-verbose" is specified or there is an error. EXAMPLES
The following example makes a verbose copy of the "test" volume named "test2" in the cell "localcell". The volume and copy both reside on "/vicepa" of "server1". % vos copy test server1 a test2 server1 a -cell localcell -verbose Starting transaction on source volume 536870921 ... done Allocating new volume id for clone of volume 536870921 ... done Allocating new volume id for copy of volume 536870921 ... done Cloning source volume 536870921 ... done Ending the transaction on the source volume 536870921 ... done Starting transaction on the cloned volume 536870926 ... done Setting flags on cloned volume 536870926 ... done Getting status of cloned volume 536870926 ... done Creating the destination volume 536870927 ... done Setting volume flags on destination volume 536870927 ... done Dumping from clone 536870926 on source to volume 536870927 on destination ... done Ending transaction on cloned volume 536870926 ... done Starting transaction on source volume 536870921 ... done Doing the incremental dump from source to destination for volume 536870921 ... done Setting volume flags on destination volume 536870927 ... done Ending transaction on destination volume 536870927 ... done Ending transaction on source volume 536870921 ... done Starting transaction on the cloned volume 536870926 ... done Deleting the cloned volume 536870926 ... done Ending transaction on cloned volume 536870926 ... done Created the VLDB entry for the volume test2 536870927 Volume 536870921 copied from server1 /vicepa to test2 on server1 /vicepa PRIVILEGE REQUIRED
The issuer must be listed in the /etc/openafs/server/UserList file on the machine specified with the -server argument and on each database server machine. If the -localauth flag is included, the issuer must instead be logged on to a server machine as the local superuser "root". SEE ALSO
vos(1), vos_clone(1), vos_move(1) COPYRIGHT
Copyright 2007 Jason Edgecombe <jason@rampaginggeek.com> This documentation is covered by the BSD License as written in the doc/LICENSE file. This man page was written by Jason Edgecombe for OpenAFS. OpenAFS 2014-04-08 VOS_COPY(1)
All times are GMT -4. The time now is 10:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy