From owner-freebsd-questions Sat Jun 1 13:12:21 2002 Delivered-To: freebsd-questions@freebsd.org Received: from vulcan.rsasecurity.com (mail.rsasecurity.com [204.167.114.123]) by hub.freebsd.org (Postfix) with SMTP id CCB8D37B400 for ; Sat, 1 Jun 2002 13:12:14 -0700 (PDT) Received: from no.name.available by vulcan.rsasecurity.com via smtpd (for hub.FreeBSD.org [216.136.204.18]) with SMTP; 1 Jun 2002 20:10:14 UT Received: from ebola.securitydynamics.com (ebola.securid.com [192.80.211.4]) by sdtihq24.securid.com (Pro-8.9.3/Pro-8.9.3) with ESMTP id QAA19709 for ; Sat, 1 Jun 2002 16:12:08 -0400 (EDT) Received: from spirit.dynas.se (localhost [127.0.0.1]) by ebola.securitydynamics.com (8.10.2+Sun/8.10.2) with SMTP id g51KAEw18514 for ; Sat, 1 Jun 2002 16:10:14 -0400 (EDT) Received: (qmail 22239 invoked from network); 1 Jun 2002 20:12:05 -0000 Received: from mikko.na.rsa.net (10.104.88.115) by spirit.se.eu.rsa.net with SMTP; 1 Jun 2002 20:12:05 -0000 Received: from mikko.na.rsa.net (localhost [127.0.0.1]) by mikko.na.rsa.net (8.12.3/8.12.3) with ESMTP id g51KC2FP086207; Sat, 1 Jun 2002 13:12:03 -0700 (PDT) (envelope-from mikko@mikko.na.rsa.net) Received: (from mikko@localhost) by mikko.na.rsa.net (8.12.3/8.12.3/Submit) id g51KC0TB086206; Sat, 1 Jun 2002 13:12:00 -0700 (PDT) Date: Sat, 1 Jun 2002 13:12:00 -0700 (PDT) From: Mikko Tyolajarvi Message-Id: <200206012012.g51KC0TB086206@mikko.na.rsa.net> To: abc@anchorageinternet.org Cc: questions@freebsd.org Orig-To: Abc Xyz Subject: Re: burncd parsing Newsgroups: local.freebsd.questions References: <200206011323.g51DNsD42542@groggy.anc.acsalaska.net> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In local.freebsd.questions you write: >FBSD 4.5 >question: why does this work ... > burncd -f /dev/cdrom -s 4 data /tmp/cd9660.iso >and this crash? >x=""; burncd "$x" -f /dev/cdrom -s 4 data /tmp/cd9660.iso >burncd: no data format selected: Undefined error: 0 >i can't tell if it's sh parsing problem, or a burncd problem. >(i wanted to use "$x" to hold the possible "dummy write" option) Remove the quotes around $x, and it will work as you expect. Without quotes, the shell will expand it to nothing. With the quotes it expands to a zero-length argument, which is not what you want. >i am guessing the sh is passing a null argument to burncd >(i am not sure if sh should do that ...), and burncd is >crashing on it cuz it doesn't use getopt() >and isn't parsing well? burncd does use getopt(), and the result is as expected. The first argument is a string that does not begin with a "-", so getopt() parsing stops. Everything else should be commands and file names, As "" is not a known command, it has to be a file name, but there has been no previous command to select data type (data, audio etc). Hence the error message. You'll get similar results from almost any other program, e.g.: atlas% x=""; ls "$x" -l ls: No such file or directory True: I don't have a file with a zero-length name in that directory. >i notice burncd is very specific about >the order of it's options. Indeed. But it works exactly as documented. I always triple-check, to make sure I haven't mis-spelled "fixate" or something... :) $.02, /Mikko -- Mikko Työläjärvi_______________________________________mikko@rsasecurity.com RSA Security To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message