[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fwd: Problem with redirecting cat command output to a file
From: |
Eric Blake |
Subject: |
Re: Fwd: Problem with redirecting cat command output to a file |
Date: |
Tue, 11 Sep 2007 06:05:48 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Pratiksha Powar on 9/11/2007 12:14 AM:
> Problem 1:
> --------
> Following is the code (in a shell script)which redirects find command output
> to a file called "src". But this command generates a file called "src?"
> instead.
>
> SOURCE_PATH="src"
> rm -f $SOURCE_PATH
> #Getting all OPS src files
> find ../../com/onmobile/noc/common -name *.java > src
Do you have spurious carriage returns (\r) in your script file? Unix
shells treat it like any other file name character, even if it doesn't
show up visually. So it probably created the file 'src\r', which ls then
displays as 'src?' with its default quoting options. One way to confirm
this would be using 'cat -A src*'.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFG5oSc84KuGfSFAYARAhkEAJ47G4Th/PySvVWcHyH2FfjQaOJTWgCbBP1P
P1n77EgdB5uadaQ2tXI7Ty0=
=uERn
-----END PGP SIGNATURE-----