Article View: comp.lang.fortran
Article #6567Re: Reading a string that contains a slash.
From: Michael Baldwin, Bruce
Date: Sun, 03 Sep 2006 08:27
Date: Sun, 03 Sep 2006 08:27
31 lines
2649 bytes
2649 bytes
Kookdancing queen, Dickless Davie tholen@antispam.ham the "irrelevaant" Ignoranus whined and tholed like the antagonistic arsehole that he is: > Niels L Ellegaard writes: > > > I would like to use fortran 95 to read a filename. In other words I > > want to read a string that contains the character "/". But it doesn't > > really work for me. > > Here is my code (I get similar results with g77 and ifort) > > > > [niels@bohr slettes]$ cat test.f > > program test > > character*100 string > > read *,string > > print *,string > > end program > > > > [niels@bohr slettes]$ gfortran test.f > > [niels@bohr slettes]$ echo hello world | ./a.out > > hello > > [niels@bohr slettes]$ echo hello_world | ./a.out > > hello_world > > [niels@bohr slettes]$ echo hello/world | ./a.out > > hello > > > > Is there a simple work-around? > > I suspect that the shell is responsible for stripping away the desired > text, not the Fortran cdoe. Try enclosing the text in quotation marks. cdoe, Dickless? WTFIT?
Technical Details
Message-ID:
<1157272058.661669.147670@m73g2000cwd.googlegroups.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!m73g2000cwd.googlegroups.com!not-for-mailReferences:
<1157098417.785570.232280@b28g2000cwb.googlegroups.com> <OISJg.6442$Cs3.1859@tornado.socal.rr.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 1094ba,f591615c8db098a0 X-Google-Thread: 102c26,2c6454f38e54b43a,start X-Google-Thread: 1138ec,2c6454f38e54b43a,start X-Google-Thread: 1156f6,2c6454f38e54b43a,start X-Google-Thread: fb021,2c6454f38e54b43a,start X-Google-Attributes: gid1094ba,gid102c26,gid1138ec,gid1156f6,gidfb021,public X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!m73g2000cwd.googlegroups.com!not-for-mail From: "Michael Baldwin, Bruce" <mbbr@mighty.co.za> Newsgroups: comp.lang.fortran,rec.music.classical,comp.os.os2.advocacy,demon.local,alt.support.autism Subject: Re: Reading a string that contains a slash. Date: 3 Sep 2006 01:27:38 -0700 Organization: http://groups.google.com Lines: 32 Message-ID: <1157272058.661669.147670@m73g2000cwd.googlegroups.com> References: <1157098417.785570.232280@b28g2000cwb.googlegroups.com> <OISJg.6442$Cs3.1859@tornado.socal.rr.com> NNTP-Posting-Host: 210.211.117.172 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1157272064 10632 127.0.0.1 (3 Sep 2006 08:27:44 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 3 Sep 2006 08:27:44 +0000 (UTC) In-Reply-To: <OISJg.6442$Cs3.1859@tornado.socal.rr.com> User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: m73g2000cwd.googlegroups.com; posting-host=210.211.117.172; posting-account=gfDFhQ0AAAD-2SlsgA4JCYtc0KAvRvTc