[comp.unix.xenix] doscp problem

qexal31@memqa.uucp (03/20/90)

Here is my problem, I am running SCO Xenix 2.3.2 with 60 megs for Xenix and 
20 megs for DOS. While under Xenix I am trying to copy several (144) files 
from the DOS partition using doscp. Here is the command I use:
             doscp c:clips/exe/*.* *.*
I would think this command would copy all files in the exe directory to the 
current Xenix directory, but I get an error message like: can't find *.*
 Now I can do a dosls c:clips/exe and get a directory listing and I can copy
1 file at a time but I can't seem to do a wildcard copy. Am I missing something
here? I can't find any more than the basic 'how to use it' in the manuals so no
help there. If I can't use wildcards with doscp then I had an idea but am not
sure how to do it: do a dosls c:clips/exe >> files then somehow via a clever
shell program, cat the file and send the output to doscp to copy each file
over 1 at a time. Sound reasonable? Any help will be appreciated. Thanks.

--bryan
++++++++++++++++++++++++++++++++++++++++++++++++++++
+                                                  +
+ Disclaimer: Haven't thought of a clever one yet  +
+                                                  +
++++++++++++++++++++++++++++++++++++++++++++++++++++

srodawa@vela.acs.oakland.edu (Dr. Srodawa) (03/21/90)

In article <459@memqa.uucp> qexal31@memqa.uucp writes:
>
>Here is my problem, I am running SCO Xenix 2.3.2 with 60 megs for Xenix and 
>20 megs for DOS. While under Xenix I am trying to copy several (144) files 
>from the DOS partition using doscp. Here is the command I use:
>             doscp c:clips/exe/*.* *.*
>I would think this command would copy all files in the exe directory to the 
>current Xenix directory, but I get an error message like: can't find *.*

The doscp manual is quite clear about this, wildcards are not supported.
I do this as follows:
1. dosls c:/clips/exe >> script.csh
2. chmod u+x script.csh
3. vi script.csh
   :1,$s;^;doscp c:/clips/exe/;
   :1,$s/$/ ./
   ZZ
4. script.csh

The first line lists the DOS filenames, one per line.
The second line allows script.csh to be executed.
The invocation of vi will change a line like
foobar
to
doscp c:/clips/exe/foobar .
within script.csh
Finally, line 4 does the dirty deed.  It usually takes me little more
than a minute or two to do this.  Ron.
-- 
| Ronald J. Srodawa               | Internet: srodawa@unix.secs.oakland.edu |
| School of Engineering and CS    | UUCP:     srodawa@egrunix.UUCP          |
| Oakland University              | Voice:    (313) 370-2247                |
| Rochester, Michigan  48309-4401 |                                         |

ron@mlfarm.uucp (Ronald Florence) (03/21/90)

In article <459@memqa.uucp> qexal31@memqa.uucp writes:
 > I can copy 1 file at a time but I can't seem to do a wildcard copy. 

Try (Bourne Shell)

	$ for i in `dosls c:wherever/whatever`
	> do
	> doscp c:$i .
	> done

Or (C Shell)

	% foreach i (`dosls c:wherever/whatever`)
	% doscp c:$i .
	% end
--

Ronald Florence			{yale,uunet}!hsi!mlfarm!ron

stecz@hotwheel.dell.com (John Steczkowski) (03/21/90)

In article <459@memqa.uucp>, qexal31@memqa.uucp writes:
> 
> Here is my problem, I am running SCO Xenix 2.3.2 with 60 megs for Xenix and 
> 20 megs for DOS. While under Xenix I am trying to copy several (144) files 
> from the DOS partition using doscp. Here is the command I use:
>              doscp c:clips/exe/*.* *.*
> --bryan

Basically, doscp doesn't support wildcards, but how about:

$for x in `dosls b:`
>do
>doscp b:$x /tmp
>done

(all on the command line)


John Steczkowski
Dell Unix Customer Support  P#: (512) 343-3571
9505 Arboretum Blvd.	    !s: uunet!dell!hotwheel!stecz
Austin, Texas 78759	    @s: stecz@hotwheel.dell.com

davidsen@sixhub.UUCP (Wm E. Davidsen Jr) (03/22/90)

exes=`dosls c: | grep "\.EXE" | sed 's/^/c:/'`
doscp $exes .

  You may want to define a shell function the do the first part if you
do it a lot, such as

dosmatch() { dosls $1 | grep "$2" | sed "s/^/$1/"; }
doscp `dosmatch c: "\.EXE"` .

  This scores about a 6 on the 1..10 "I feel clever" scale. I don't
doubt you'll get some other, perhaps simpler, answers.
-- 
bill davidsen - davidsen@sixhub.uucp (uunet!crdgw1!sixhub!davidsen)
    sysop *IX BBS and Public Access UNIX
    moderator of comp.binaries.ibm.pc
"Getting old is bad, but it beats the hell out of the alternative" -anon

bill@bilver.UUCP (Bill Vermillion) (03/22/90)

In article <459@memqa.uucp> qexal31@memqa.uucp writes:
>
>Here is my problem, I am running SCO Xenix 2.3.2 with 60 megs for Xenix and 
>20 megs for DOS. While under Xenix I am trying to copy several (144) files 
>from the DOS partition using doscp. Here is the command I use:
>             doscp c:clips/exe/*.* *.*
>I would think this command would copy all files in the exe directory to the 
>current Xenix directory, but I get an error message like: can't find *.*
> Now I can do a dosls c:clips/exe and get a directory listing and I can copy
>1 file at a time but I can't seem to do a wildcard copy. Am I missing something
>here?

Yes - you are missing something here.  The "notes" section of the manual that
says "It is not possible to refer to DOS directories with wild card
specifications. .... "  It's documented and doscp won't do it.

And also, you don't want the trailing *.*, you want . as the target directory.

>      I can't find any more than the basic 'how to use it' in the manuals so no
>help there. If I can't use wildcards with doscp then I had an idea but am not
>sure how to do it: do a dosls c:clips/exe >> files then somehow via a clever
>shell program, cat the file and send the output to doscp to copy each file
>over 1 at a time. Sound reasonable? Any help will be appreciated. Thanks.

Well I don't know how clever this is, but Lee Penn at DLP in Cinncinnati wrote
this and says to pass it around.

---------
ii=1
cat << !

**** Recursive MSDOS to XENIX doscp command *******************************
       DLP Technologies Inc.		
This command copies all files from a dos directory to the current
Xenix working directory.  The file names are converted from uppercase 
coming drom DOS to lower casw when they are in the Xenix directory.
***************************************************************************

!
echo "Please enter full dos directory name includind drive \c"
read dosdir
echo
for arg in `dosls $dosdir | tr [A-Z] [a-z]`
   do
   echo $ii "doscp $dosdir/$arg  ."
   doscp  $dosdir/$arg  .
   ii="`expr $ii + 1`"
done
------------------

There you have it. And it works.

bill

-- 
Bill Vermillion - UUCP: uunet!tarpit!bilver!bill
                      : bill@bilver.UUCP

terry@pride386.UUCP (Terry Lyons) (03/22/90)

In article <459@memqa.uucp>, qexal31@memqa.uucp writes:
>
> from the DOS partition using doscp. Here is the command I use:
>              doscp c:clips/exe/*.* *.*
> I would think this command would copy all files in the exe directory to the
> current Xenix directory, but I get an error message like: can't find *.*


nope... wild cards are a no-no

was a long time ago ( don't use DOS much )

dosdir c:/clips/exe | awk ' /exe/ { print " doscp
c:/clips/exe/",$1,".",$2," ." } ' | sh

I think this will work if it doesn't change | sh to foo ; sh foo

that should do it, if you find you do this a lot type the command
into a file and just change the file information as needed
 hope this helps!
terry

-- 
**************************************************************************
*  UUNET	...!pride386!terry       *  FAX	(714) 739 - 2203         *
*  Pern is a dragons best freind                                         *
**************************************************************************

barton@holston.UUCP (Barton A. Fisk) (03/23/90)

In article <459@memqa.uucp>, qexal31@memqa.uucp writes:
> 
> Here is my problem, I am running SCO Xenix 2.3.2 with 60 megs for Xenix and 
> 20 megs for DOS. While under Xenix I am trying to copy several (144) files 
> from the DOS partition using doscp. Here is the command I use:
>              doscp c:clips/exe/*.* *.*

Yes, wildcards don't work with doscp :-(. However you can use
a shell construct like: 

		for i in `dosls c:clips/exe`
		do
		doscp c:clips/exe/$i .
		done

This would copy everything in clips/exe to your current dir.
Sure beats typing. Hope this helps.
-- 
uucp: holston!barton

chris@choreo.COM.COM (Chris Hare / System Manager) (03/23/90)

In article <459@memqa.uucp>, qexal31@memqa.uucp writes:
> 
> Here is my problem, I am running SCO Xenix 2.3.2 with 60 megs for Xenix and 
> 20 megs for DOS. While under Xenix I am trying to copy several (144) files 
> from the DOS partition using doscp. Here is the command I use:
>              doscp c:clips/exe/*.* *.*

You haven't missed anything.  There is NO WILDCARD support in doscp.  The
reason is that the wildcards perform filename generation, therefore, doscp
cannot.  (I think it is kind of stupid, personally).

Try this - you can adapt it to suit :

$ dosls a: (or whatever device )
$ for entry in `dosls a:`
> do
> doscp a:$entry . (or directory)
> done
$

Be aware that this will also cause all of your files to be named in upper
case.  You can use the following to fix it.

:
# @(#) tolower v1.0
# Copyright Chris Hare 1988
#

if [ ! "$*" ]
then
   echo "Preparing to rename ALL files. OK to continue? (y/n) \c"
   read OK
   case $OK in
      [yY])
	 LIST=`ls`
         break
         ;;
      *)
         echo "Usage : `basename $0` file [ file ... ]"
         exit 1
         ;;
   esac
else
   LIST=$*
fi

for NAME in $LIST
do
   NEW_NAME=`echo $NAME | tr "[A-Z]" "[a-z]"`
   if [ "$NAME" != "$NEW_NAME" ]
   then
      echo "Renaming $NAME to $NEW_NAME"
      mv ./$NAME ./$NEW_NAME
   fi
done

Good Luck

------------------------------------------------------------
Chris Hare, Co-ordinator, Systems Management         *** IT WORKS FOR ME! ***
Authorized SCO Instructor
Choreo Systems Inc.                                  500-150 Laurier Ave W.
                                                     Ottawa, Ontario K1P 5J4
E-MAIL ...!choreo!chris                              Voice (613) 238-1050
                                                     Fax   (613) 238-4453