* File names with spaces
@ 2003-02-17 19:11 Theo. Sean Schulze
2003-02-17 20:34 ` Brian Jackson
0 siblings, 1 reply; 24+ messages in thread
From: Theo. Sean Schulze @ 2003-02-17 19:11 UTC (permalink / raw)
To: linux-newbie
Hello,
I am trying to write a bash shell script that will translate spaces in file names into underline characters. This is the script as I have it now:
for file in `ls`
do
echo $file
newfile=`ls ${file} | tr '[:space:]' '[_*]'`
echo File is named ${file}
echo The new file is named ${newfile}
# [[ -s $newfile ]] || (mv $file $newfile)
sleep 2
done
The lines that begin with echo and the sleep line are for debugging. What they have shown me is that the $file is getting set to the first word in the file name on the first iteration, the second word on the second interation, etc. (The file names look like "001 of 150 files", "002 of 150 files", etc.) So, on the first iteration, $file is egual to "001", on the second iteration $file is equal to "of", etc. Yet, if I go to the directory and issue `ls`, the filenames are shown as one would expect with the whole four word filename on one line.
Can anyone give me a hint on how to fix this so that the whole filename is loaded into $file?
TIA,
Sean
--
Theo. Sean Schulze
tschulze@teamfinders.org
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: File names with spaces 2003-02-17 19:11 File names with spaces Theo. Sean Schulze @ 2003-02-17 20:34 ` Brian Jackson 2003-02-18 21:37 ` Theo. Sean Schulze 0 siblings, 1 reply; 24+ messages in thread From: Brian Jackson @ 2003-02-17 20:34 UTC (permalink / raw) To: Theo. Sean Schulze, linux-newbie You can try to adapt this example from The Advanced Bash Scripting Guide: http://www.tldp.org/LDP/abs/html/moreadv.html#EX57 It deletes the file, but it shouldn't be too hard to adapt to your needs. --Brian On Monday 17 February 2003 01:11 pm, Theo. Sean Schulze wrote: > Hello, > > I am trying to write a bash shell script that will translate spaces in file > names into underline characters. This is the script as I have it now: > > > for file in `ls` > do > echo $file > newfile=`ls ${file} | tr '[:space:]' '[_*]'` > echo File is named ${file} > echo The new file is named ${newfile} > # [[ -s $newfile ]] || (mv $file $newfile) > sleep 2 > done > > The lines that begin with echo and the sleep line are for debugging. What > they have shown me is that the $file is getting set to the first word in > the file name on the first iteration, the second word on the second > interation, etc. (The file names look like "001 of 150 files", "002 of 150 > files", etc.) So, on the first iteration, $file is egual to "001", on the > second iteration $file is equal to "of", etc. Yet, if I go to the > directory and issue `ls`, the filenames are shown as one would expect with > the whole four word filename on one line. > > Can anyone give me a hint on how to fix this so that the whole filename is > loaded into $file? > > TIA, > Sean - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: File names with spaces 2003-02-17 20:34 ` Brian Jackson @ 2003-02-18 21:37 ` Theo. Sean Schulze 2003-02-20 10:22 ` J. 0 siblings, 1 reply; 24+ messages in thread From: Theo. Sean Schulze @ 2003-02-18 21:37 UTC (permalink / raw) To: linux-newbie Thanks, that did help, although it didn't solve the problem. I now recognize that the problem is in assigning the variable. Both my version with ls and the version with find in the example give the expected results when printing to the console, but they both fail when used to assign a string including spaces to a variable. I need to find a way to maintain the integrity of the string as I assign it to the file variable. I tried `echo (ls -1)` and `echo "(ls -1)"`, but neither works. Changing the parentheses to brackets doesn't help either. Cheers, Sean On Mon, Feb 17, 2003 at 02:34:16PM -0600, Brian Jackson hunted and pecked out: > You can try to adapt this example from The Advanced Bash Scripting Guide: > http://www.tldp.org/LDP/abs/html/moreadv.html#EX57 > > It deletes the file, but it shouldn't be too hard to adapt to your needs. > > --Brian > > On Monday 17 February 2003 01:11 pm, Theo. Sean Schulze wrote: > > Hello, > > > > I am trying to write a bash shell script that will translate spaces in file > > names into underline characters. This is the script as I have it now: > > > > > > for file in `ls` > > do > > echo $file > > newfile=`ls ${file} | tr '[:space:]' '[_*]'` > > echo File is named ${file} > > echo The new file is named ${newfile} > > # [[ -s $newfile ]] || (mv $file $newfile) > > sleep 2 > > done > > > > The lines that begin with echo and the sleep line are for debugging. What > > they have shown me is that the $file is getting set to the first word in > > the file name on the first iteration, the second word on the second > > interation, etc. (The file names look like "001 of 150 files", "002 of 150 > > files", etc.) So, on the first iteration, $file is egual to "001", on the > > second iteration $file is equal to "of", etc. Yet, if I go to the > > directory and issue `ls`, the filenames are shown as one would expect with > > the whole four word filename on one line. > > > > Can anyone give me a hint on how to fix this so that the whole filename is > > loaded into $file? > > > > TIA, > > Sean > -- Theo. Sean Schulze tschulze@teamfinders.org - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: File names with spaces 2003-02-18 21:37 ` Theo. Sean Schulze @ 2003-02-20 10:22 ` J. 2003-02-20 17:13 ` [SOLVED] " Theo. Sean Schulze 2003-02-21 7:29 ` file transfer via telnet ichi 0 siblings, 2 replies; 24+ messages in thread From: J. @ 2003-02-20 10:22 UTC (permalink / raw) To: linux-newbie On Tue, 18 Feb 2003, Theo. Sean Schulze wrote: > Thanks, that did help, although it didn't solve the problem. > I now recognize that the problem is in assigning the variable. > Both my version with ls and the version with find in the example give > the expected results when printing to the console, > but they both fail when used to assign a string including spaces to a > variable. I need to find a way to maintain the integrity of the string > as I assign it to the file variable. I tried `echo (ls -1)` and `echo > "(ls -1)"`, but neither works. Changing the parentheses to brackets > doesn't help either. > > Cheers, > Sean Assigning variables does not happen in the `ls -1' statement. This only generates strings. You need a command that read's the variables correctly. Use `read', as in: ls -1 | while read file ; do echo "$file" ; done or find . -type f | while read file ; do echo "$file" done or more exotic, array version. IFS=$'\n' eval 'lines=( $(cat < $file) )' # now you have a array of lines.... which can be proccessed further.. These all where tested and work just fine. G00d lUcK J. - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs ^ permalink raw reply [flat|nested] 24+ messages in thread
* [SOLVED] Re: File names with spaces 2003-02-20 10:22 ` J. @ 2003-02-20 17:13 ` Theo. Sean Schulze 2003-02-20 19:43 ` J. 2003-02-21 8:59 ` J. 2003-02-21 7:29 ` file transfer via telnet ichi 1 sibling, 2 replies; 24+ messages in thread From: Theo. Sean Schulze @ 2003-02-20 17:13 UTC (permalink / raw) To: linux-newbie J., Thanks for your suggestions. While googling comp.unix.shell today, I found yet another method. I was not aware that "*" when used by itself matches every filename in a directory. Apparently, part of the problem I was having was a side effect of ls and find. Here is the script that I used: #!/usr/bin/bash for file in * do newfile="`echo "$file" | tr '[:blank:]' '[_*]'`" mv "$file" "$newfile" done I also learned something important about tr. I was using [:space:], but that is not appropriate here. [:space:] includes horizontal as well as vertical whitespace. That means I was transforming linefeeds as well as spaces. [:blank:] is exclusively horizontal whitespace, which is what I needed. Thanks to all of you who contributed. I appreciate your help. Cheers, Sean On Thu, Feb 20, 2003 at 11:22:36AM +0100, J. hunted and pecked out: > On Tue, 18 Feb 2003, Theo. Sean Schulze wrote: > > > Thanks, that did help, although it didn't solve the problem. > > I now recognize that the problem is in assigning the variable. > > Both my version with ls and the version with find in the example give > > the expected results when printing to the console, > > but they both fail when used to assign a string including spaces to a > > variable. I need to find a way to maintain the integrity of the string > > as I assign it to the file variable. I tried `echo (ls -1)` and `echo > > "(ls -1)"`, but neither works. Changing the parentheses to brackets > > doesn't help either. > > > > Cheers, > > Sean > > Assigning variables does not happen in the `ls -1' statement. This only > generates strings. You need a command that read's the variables correctly. > Use `read', as in: > > ls -1 | while read file ; do echo "$file" ; done > > or > > find . -type f | while read file ; do > echo "$file" > done > > or more exotic, array version. > > IFS=$'\n' eval 'lines=( $(cat < $file) )' > # now you have a array of lines.... which can be proccessed further.. > > These all where tested and work just fine. > > G00d lUcK > > J. > > - > To unsubscribe from this list: send the line "unsubscribe linux-newbie" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.linux-learn.org/faqs -- Theo. Sean Schulze tschulze@teamfinders.org - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [SOLVED] Re: File names with spaces 2003-02-20 17:13 ` [SOLVED] " Theo. Sean Schulze @ 2003-02-20 19:43 ` J. 2003-02-21 8:59 ` J. 1 sibling, 0 replies; 24+ messages in thread From: J. @ 2003-02-20 19:43 UTC (permalink / raw) To: linux-newbie On Thu, 20 Feb 2003, Theo. Sean Schulze wrote: > J., > > Thanks for your suggestions. No problemo, btw: 4 out of 5 pages on teamfinders.org are generating http 404 not found messages. I think you should have a critical look at all the http links in the main page. J. - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [SOLVED] Re: File names with spaces 2003-02-20 17:13 ` [SOLVED] " Theo. Sean Schulze 2003-02-20 19:43 ` J. @ 2003-02-21 8:59 ` J. 2003-02-23 13:30 ` Theo. Sean Schulze 1 sibling, 1 reply; 24+ messages in thread From: J. @ 2003-02-21 8:59 UTC (permalink / raw) To: linux-newbie On Thu, 20 Feb 2003, Theo. Sean Schulze wrote: > J., > > Thanks for your suggestions. While googling comp.unix.shell today, I found yet another method. I was not aware that "*" when used by itself matches every filename in a directory. Apparently, part of the problem I was having was a side effect of ls and find. Here is the script that I used: > > #!/usr/bin/bash > for file in * > do > newfile="`echo "$file" | tr '[:blank:]' '[_*]'`" > mv "$file" "$newfile" > done > > I also learned something important about tr. I was using [:space:], but that is not appropriate here. [:space:] includes horizontal as well as vertical whitespace. That means I was transforming linefeeds as well as spaces. [:blank:] is exclusively horizontal whitespace, which is what I needed. > > Thanks to all of you who contributed. I appreciate your help. > > Cheers, > Sean BTW, please remember that `blank' is a GNU extension, regarding portability issues.. etc.. ~$ man isblank J. p.s. Please use a more sane line-wrapping. - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [SOLVED] Re: File names with spaces 2003-02-21 8:59 ` J. @ 2003-02-23 13:30 ` Theo. Sean Schulze 2003-02-23 14:12 ` Problem installing avi libraries Peter Howell 2003-02-23 14:46 ` [SOLVED] Re: File names with spaces J. 0 siblings, 2 replies; 24+ messages in thread From: Theo. Sean Schulze @ 2003-02-23 13:30 UTC (permalink / raw) To: linux-newbie On Fri, Feb 21, 2003 at 09:59:37AM +0100, J. hunted and pecked out: [snip] > > BTW, > > please remember that `blank' is a GNU extension, regarding portability > issues.. etc.. > > ~$ man isblank > This shouldn't be a problem, since I will only be using it on GNU/Linux. Also, [:blank:] is a character set descriptor for tr. I scanned the source for tr and I don't see any calls to isblank. Should be ok for my limited usage. > > p.s. > Please use a more sane line-wrapping. > I wasn't aware that there was a problem with my line wrapping. I have posted to the list a number of times, and you are the first to mention it. I am using mutt with vim as the editor, and it softwraps to the width of the xterm. It doesn't hardwrap at all. What is the problem specifically? -- Theo. Sean Schulze tschulze@teamfinders.org - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs ^ permalink raw reply [flat|nested] 24+ messages in thread
* Problem installing avi libraries 2003-02-23 13:30 ` Theo. Sean Schulze @ 2003-02-23 14:12 ` Peter Howell 2003-02-23 15:25 ` Ray Olszewski 2003-02-23 14:46 ` [SOLVED] Re: File names with spaces J. 1 sibling, 1 reply; 24+ messages in thread From: Peter Howell @ 2003-02-23 14:12 UTC (permalink / raw) To: linux-newbie I've been trying to install the avifiles to allow me to turn my linux box into a vcr. Unfortunately, by naivety is getting me in trouble. Here is what I've done, in what I hope is sufficient detail Downloaded avifile-0.53.5.tar.gz and binaries-010122.zip. # tar xvfz avifile-0.53-5.tar.gz # cd avifile-0.53-5 # ./configure loading cache ./config.cache checking for a BSD compatible install... (cached) /usr/bin/install -c checking whether build environment is sane... yes checking whether make sets ${MAKE}... (cached) yes checking for working aclocal... found checking for working autoconf... found checking for working automake... found checking for working autoheader... found checking for working makeinfo... found checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu checking for gcc... (cached) gcc checking whether the C compiler (gcc ) works... yes checking whether the C compiler (gcc ) is a cross-compiler... no checking whether we are using GNU C... (cached) yes checking whether gcc accepts -g... (cached) yes checking how to run the C preprocessor... (cached) gcc -E checking for c++... (cached) c++ checking whether the C++ compiler (c++ ) works... yes checking whether the C++ compiler (c++ ) is a cross-compiler... no checking whether we are using GNU C++... (cached) yes checking whether c++ accepts -g... (cached) yes checking for a BSD compatible install... /usr/bin/install -c checking for ranlib... (cached) ranlib checking for ld used by GCC... (cached) /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... (cached) yes checking for BSD-compatible nm... (cached) /usr/bin/nm -B checking whether ln -s works... (cached) yes checking for object suffix... o checking for executable suffix... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions ... yes checking if gcc static flag -static works... -static checking if the linker (/usr/bin/ld) is GNU ld... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking command to parse /usr/bin/nm -B output... ok checking how to hardcode library paths into programs... immediate checking for /usr/bin/ld option to reload object files... -r checking dynamic linker characteristics... Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking for objdir... .libs creating libtool checking for dlopen in -ldl... (cached) yes checking for pthreads... -lpthread yes checking for ANSI C header files... (cached) yes checking for fcntl.h... (cached) yes checking for limits.h... (cached) yes checking for malloc.h... (cached) yes checking for sys/ioctl.h... (cached) yes checking for sys/time.h... (cached) yes checking for unistd.h... (cached) yes checking for working const... (cached) yes checking for inline... (cached) inline checking whether time.h and sys/time.h may both be included... (cached) yes checking whether gcc needs -traditional... (cached) no checking for 8-bit clean memcmp... (cached) yes checking for unistd.h... (cached) yes checking for getpagesize... (cached) yes checking for working mmap... (cached) yes checking return type of signal handlers... (cached) void checking for vprintf... (cached) yes checking for ftime... (cached) yes checking for gettimeofday... (cached) yes checking for strdup... (cached) yes checking for strstr... (cached) yes checking for X... (cached) libraries /usr/X11R6/lib, headers /usr/X11R6/include checking for Qt... (cached) libraries /usr/lib/qt3-gcc3.2/lib, headers /usr/lib/qt3-gcc3.2/includ e checking for moc... (cached) /usr/lib/qt3-gcc3.2/bin/moc checking for uic... (cached) /usr/lib/qt3-gcc3.2/bin/uic checking whether we like this Qt installation... checking for /usr/lib/qt3-gcc3.2/include/qvarian t.h... (cached) yes checking whether to build QtVidcap... checking for /usr/lib/qt3-gcc3.2/include/qtable.h... (cache d) yes checking for XF86DGAQueryExtension in -lXxf86dga... (cached) yes checking for XF86VidModeSwitchMode in -lXxf86vm... (cached) yes checking for sdl-config... (cached) /usr/bin/sdl-config checking for SDL - version >= 1.1.3... yes checking whether to build ac3 decoder module... no creating ./config.status creating ./Makefile creating lib/Makefile creating lib/loader/Makefile creating lib/videocodec/Makefile creating lib/audiodecoder/Makefile creating lib/videocodec/Makefile creating lib/avifile/Makefile creating lib/aviplay/Makefile creating player/Makefile creating lib/audioencoder/Makefile creating lib/audioencoder/lame3.70/Makefile creating lib/audiodecoder/mpeg/Makefile creating samples/Makefile creating samples/avitest/Makefile creating samples/benchmark/Makefile creating samples/extractor/Makefile creating samples/qtvidcap/Makefile creating include/Makefile creating include/wine/Makefile creating bin/Makefile creating samples/qtrecompress/Makefile creating avifile-config creating avifile.spec creating lib/videocodec/DirectShow/Makefile creating include/config.h include/config.h is unchanged Everything appears to be fine, except for the check that my compilers are cross-compilers. The documentation isn't clear about whether this is a fatal error, so I proceeded with the next step: # make Making all in include make[1]: Entering directory `/home/nupgup/Stuff/TV/avifile-0.53.5/include' make all-recursive make[2]: Entering directory `/home/nupgup/Stuff/TV/avifile-0.53.5/include' Making all in wine make[3]: Entering directory `/home/nupgup/Stuff/TV/avifile-0.53.5/include/wine' make[3]: Nothing to be done for `all'. make[3]: Leaving directory `/home/nupgup/Stuff/TV/avifile-0.53.5/include/wine' make[3]: Entering directory `/home/nupgup/Stuff/TV/avifile-0.53.5/include' make[3]: Leaving directory `/home/nupgup/Stuff/TV/avifile-0.53.5/include' make[2]: Leaving directory `/home/nupgup/Stuff/TV/avifile-0.53.5/include' make[1]: Leaving directory `/home/nupgup/Stuff/TV/avifile-0.53.5/include' Making all in lib make[1]: Entering directory `/home/nupgup/Stuff/TV/avifile-0.53.5/lib' Making all in loader make[2]: Entering directory `/home/nupgup/Stuff/TV/avifile-0.53.5/lib/loader' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/home/nupgup/Stuff/TV/avifile-0.53.5/lib/loader' Making all in videocodec make[2]: Entering directory `/home/nupgup/Stuff/TV/avifile-0.53.5/lib/videocodec' Making all in DirectShow make[3]: Entering directory `/home/nupgup/Stuff/TV/avifile-0.53.5/lib/videocodec/DirectShow' /bin/sh ../../../libtool --silent --mode=compile c++ -DHAVE_CONFIG_H -I. -I. -I../../../include -g -march=i586 -I/usr/X11R6/include -I/usr/include/SDL -D_REENTRANT -w -I../../../include -march=i586 -c inputpin.cpp inputpin.cpp: In constructor `CEnumPins::CEnumPins(IPin*, IPin*)': inputpin.cpp:79: invalid conversion from `long int (*)(IUnknown*, GUID*, void**)' to `long int (*)(IUnknown*, GUID*, void**)' inputpin.cpp:80: invalid conversion from `long int (*)(IUnknown*)' to `long int (*)(IUnknown*)' inputpin.cpp:81: invalid conversion from `long int (*)(IUnknown*)' to `long int (*)(IUnknown*)' inputpin.cpp:82: invalid conversion from `HRESULT (*)(IEnumPins*, long unsigned int, IPin**, ULONG*)' to `HRESULT (*)(IEnumPins*, long unsigned int, IPin**, ULONG*)' inputpin.cpp:83: invalid conversion from `HRESULT (*)(IEnumPins*, long unsigned int)' to `HRESULT (*)(IEnumPins*, long unsigned int)' inputpin.cpp:84: invalid conversion from `HRESULT (*)(IEnumPins*)' to `HRESULT (*)(IEnumPins*)' inputpin.cpp:85: invalid conversion from `HRESULT (*)(IEnumPins*, IEnumPins**)' to `HRESULT (*)(IEnumPins*, IEnumPins**)' inputpin.cpp: In constructor `CInputPin::CInputPin(CBaseFilter*, const AM_MEDIA_TYPE&)': inputpin.cpp:151: invalid conversion from `long int (*)(IUnknown*, GUID*, void**)' to `long int (*)(IUnknown*, GUID*, void**)' inputpin.cpp:152: invalid conversion from `long int (*)(IUnknown*)' to `long int (*)(IUnknown*)' inputpin.cpp:153: invalid conversion from `long int (*)(IUnknown*)' to `long int (*)(IUnknown*)' inputpin.cpp:154: invalid conversion from `HRESULT (*)(IPin*, IPin*, AM_MEDIA_TYPE*)' to `HRESULT (*)(IPin*, IPin*, AM_MEDIA_TYPE*)' inputpin.cpp:155: invalid conversion from `HRESULT (*)(IPin*, IPin*, const AM_MEDIA_TYPE*)' to `HRESULT (*)(IPin*, IPin*, const AM_MEDIA_TYPE*)' inputpin.cpp:156: invalid conversion from `HRESULT (*)(IPin*)' to `HRESULT (*)(IPin*)' inputpin.cpp:157: invalid conversion from `HRESULT (*)(IPin*, IPin**)' to ` HRESULT (*)(IPin*, IPin**)' inputpin.cpp:158: invalid conversion from `HRESULT (*)(IPin*, AM_MEDIA_TYPE*)' to `HRESULT (*)(IPin*, AM_MEDIA_TYPE*)' inputpin.cpp:159: invalid conversion from `HRESULT (*)(IPin*, PIN_INFO*)' to ` HRESULT (*)(IPin*, PIN_INFO*)' inputpin.cpp:160: invalid conversion from `HRESULT (*)(IPin*, PIN_DIRECTION*)' to `HRESULT (*)(IPin*, PIN_DIRECTION*)' inputpin.cpp:161: invalid conversion from `HRESULT (*)(IPin*, WCHAR**)' to ` HRESULT (*)(IPin*, WCHAR**)' inputpin.cpp:162: invalid conversion from `HRESULT (*)(IPin*, const AM_MEDIA_TYPE*)' to `HRESULT (*)(IPin*, const AM_MEDIA_TYPE*)' inputpin.cpp:163: invalid conversion from `HRESULT (*)(IPin*, IEnumMediaTypes**)' to `HRESULT (*)(IPin*, IEnumMediaTypes**)' inputpin.cpp:164: invalid conversion from `HRESULT (*)(IPin*, IPin**, ULONG*)' to `HRESULT (*)(IPin*, IPin**, ULONG*)' inputpin.cpp:165: invalid conversion from `HRESULT (*)(IPin*)' to `HRESULT (*)(IPin*)' inputpin.cpp:166: invalid conversion from `HRESULT (*)(IPin*)' to `HRESULT (*)(IPin*)' inputpin.cpp:167: invalid conversion from `HRESULT (*)(IPin*)' to `HRESULT (*)(IPin*)' inputpin.cpp:168: invalid conversion from `HRESULT (*)(IPin*, long long int, long long int, double)' to `HRESULT (*)(IPin*, long long int, long long int, double)' inputpin.cpp: In constructor `CBaseFilter::CBaseFilter(const AM_MEDIA_TYPE&, CBaseFilter2*)': inputpin.cpp:325: invalid conversion from `long int (*)(IUnknown*, GUID*, void**)' to `long int (*)(IUnknown*, GUID*, void**)' inputpin.cpp:326: invalid conversion from `long int (*)(IUnknown*)' to `long int (*)(IUnknown*)' inputpin.cpp:327: invalid conversion from `long int (*)(IUnknown*)' to `long int (*)(IUnknown*)' inputpin.cpp:328: invalid conversion from `HRESULT (*)(IBaseFilter*, CLSID*)' to `HRESULT (*)(IBaseFilter*, CLSID*)' inputpin.cpp:329: invalid conversion from `HRESULT (*)(IBaseFilter*)' to ` HRESULT (*)(IBaseFilter*)' inputpin.cpp:330: invalid conversion from `HRESULT (*)(IBaseFilter*)' to ` HRESULT (*)(IBaseFilter*)' inputpin.cpp:331: invalid conversion from `HRESULT (*)(IBaseFilter*, long long int)' to `HRESULT (*)(IBaseFilter*, long long int)' inputpin.cpp:332: invalid conversion from `HRESULT (*)(IBaseFilter*, long unsigned int, void*)' to `HRESULT (*)(IBaseFilter*, long unsigned int, void*)' inputpin.cpp:333: invalid conversion from `HRESULT (*)(IBaseFilter*, IReferenceClock*)' to `HRESULT (*)(IBaseFilter*, IReferenceClock*)' inputpin.cpp:334: invalid conversion from `HRESULT (*)(IBaseFilter*, IReferenceClock**)' to `HRESULT (*)(IBaseFilter*, IReferenceClock**)' inputpin.cpp:335: invalid conversion from `HRESULT (*)(IBaseFilter*, IEnumPins**)' to `HRESULT (*)(IBaseFilter*, IEnumPins**)' inputpin.cpp:336: invalid conversion from `HRESULT (*)(IBaseFilter*, const WCHAR*, IPin**)' to `HRESULT (*)(IBaseFilter*, const WCHAR*, IPin**)' inputpin.cpp:337: invalid conversion from `HRESULT (*)(IBaseFilter*, void*)' to `HRESULT (*)(IBaseFilter*, void*)' inputpin.cpp:338: invalid conversion from `HRESULT (*)(IBaseFilter*, IFilterGraph*, const WCHAR*)' to `HRESULT (*)(IBaseFilter*, IFilterGraph*, const WCHAR*)' inputpin.cpp:339: invalid conversion from `HRESULT (*)(IBaseFilter*, WCHAR**)' to `HRESULT (*)(IBaseFilter*, WCHAR**)' inputpin.cpp: In constructor `CBaseFilter2::CBaseFilter2()': inputpin.cpp:457: invalid conversion from `long int (*)(IUnknown*, GUID*, void**)' to `long int (*)(IUnknown*, GUID*, void**)' inputpin.cpp:458: invalid conversion from `long int (*)(IUnknown*)' to `long int (*)(IUnknown*)' inputpin.cpp:459: invalid conversion from `long int (*)(IUnknown*)' to `long int (*)(IUnknown*)' inputpin.cpp:460: invalid conversion from `HRESULT (*)(IBaseFilter*, CLSID*)' to `HRESULT (*)(IBaseFilter*, CLSID*)' inputpin.cpp:461: invalid conversion from `HRESULT (*)(IBaseFilter*)' to ` HRESULT (*)(IBaseFilter*)' inputpin.cpp:462: invalid conversion from `HRESULT (*)(IBaseFilter*)' to ` HRESULT (*)(IBaseFilter*)' inputpin.cpp:463: invalid conversion from `HRESULT (*)(IBaseFilter*, long long int)' to `HRESULT (*)(IBaseFilter*, long long int)' inputpin.cpp:464: invalid conversion from `HRESULT (*)(IBaseFilter*, long unsigned int, void*)' to `HRESULT (*)(IBaseFilter*, long unsigned int, void*)' inputpin.cpp:465: invalid conversion from `HRESULT (*)(IBaseFilter*, IReferenceClock*)' to `HRESULT (*)(IBaseFilter*, IReferenceClock*)' inputpin.cpp:466: invalid conversion from `HRESULT (*)(IBaseFilter*, IReferenceClock**)' to `HRESULT (*)(IBaseFilter*, IReferenceClock**)' inputpin.cpp:467: invalid conversion from `HRESULT (*)(IBaseFilter*, IEnumPins**)' to `HRESULT (*)(IBaseFilter*, IEnumPins**)' inputpin.cpp:468: invalid conversion from `HRESULT (*)(IBaseFilter*, const WCHAR*, IPin**)' to `HRESULT (*)(IBaseFilter*, const WCHAR*, IPin**)' inputpin.cpp:469: invalid conversion from `HRESULT (*)(IBaseFilter*, void*)' to `HRESULT (*)(IBaseFilter*, void*)' inputpin.cpp:470: invalid conversion from `HRESULT (*)(IBaseFilter*, IFilterGraph*, const WCHAR*)' to `HRESULT (*)(IBaseFilter*, IFilterGraph*, const WCHAR*)' inputpin.cpp:471: invalid conversion from `HRESULT (*)(IBaseFilter*, WCHAR**)' to `HRESULT (*)(IBaseFilter*, WCHAR**)' inputpin.cpp: In constructor `CRemotePin2::CRemotePin2(CBaseFilter2*)': inputpin.cpp:478: invalid conversion from `long int (*)(IUnknown*, GUID*, void**)' to `long int (*)(IUnknown*, GUID*, void**)' inputpin.cpp:479: invalid conversion from `long int (*)(IUnknown*)' to `long int (*)(IUnknown*)' inputpin.cpp:480: invalid conversion from `long int (*)(IUnknown*)' to `long int (*)(IUnknown*)' inputpin.cpp:481: invalid conversion from `HRESULT (*)(IPin*, PIN_INFO*)' to ` HRESULT (*)(IPin*, PIN_INFO*)' inputpin.cpp: In constructor `CRemotePin::CRemotePin(CBaseFilter*, IPin*)': inputpin.cpp:488: invalid conversion from `long int (*)(IUnknown*, GUID*, void**)' to `long int (*)(IUnknown*, GUID*, void**)' inputpin.cpp:489: invalid conversion from `long int (*)(IUnknown*)' to `long int (*)(IUnknown*)' inputpin.cpp:490: invalid conversion from `long int (*)(IUnknown*)' to `long int (*)(IUnknown*)' inputpin.cpp:491: invalid conversion from `HRESULT (*)(IPin*, PIN_DIRECTION*)' to `HRESULT (*)(IPin*, PIN_DIRECTION*)' inputpin.cpp:492: invalid conversion from `HRESULT (*)(IPin*, IPin**)' to ` HRESULT (*)(IPin*, IPin**)' inputpin.cpp:493: invalid conversion from `HRESULT (*)(IPin*, AM_MEDIA_TYPE*)' to `HRESULT (*)(IPin*, AM_MEDIA_TYPE*)' inputpin.cpp:494: invalid conversion from `HRESULT (*)(IPin*, PIN_INFO*)' to ` HRESULT (*)(IPin*, PIN_INFO*)' make[3]: *** [inputpin.lo] Error 1 make[3]: Leaving directory `/home/nupgup/Stuff/TV/avifile-0.53.5/lib/videocodec/DirectShow' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/nupgup/Stuff/TV/avifile-0.53.5/lib/videocodec' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/nupgup/Stuff/TV/avifile-0.53.5/lib' make: *** [all-recursive] Error 1 Now these errors are a bit more worrisome, and this is as far as I've been able to get. Here is my kernal info Linux version 2.4.18-24.8.0 (bhcompile@tweety.devel.redhat.com) (gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)) #1 Fri Jan 31 07:28:55 EST 2003 Has anyone out there seen similar errors? Do you think the problem is really with gcc, or am I off base? I've done some research, and I don't know what I'm supposed to be cross-compiling to. Thanks Peter - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: Problem installing avi libraries 2003-02-23 14:12 ` Problem installing avi libraries Peter Howell @ 2003-02-23 15:25 ` Ray Olszewski 0 siblings, 0 replies; 24+ messages in thread From: Ray Olszewski @ 2003-02-23 15:25 UTC (permalink / raw) To: linux-newbie At 09:12 AM 2/23/03 -0500, Peter Howell wrote: >I've been trying to install the avifiles to allow me to turn my linux >box into a vcr. Unfortunately, by naivety is getting me in trouble. >Here is what I've done, in what I hope is sufficient detail > >Downloaded avifile-0.53.5.tar.gz and binaries-010122.zip. [details deleted] The current version of avifile is 0.7.32 (20030219), available for download at http://avifile.sourceforge.net/ . The version you are trying to compile is so old that only luck would make it compatible with the current g++ compiler and its libraries. (The cross-compiler check result is just fine, BTW ... it merely confirms that you are compiling the source for the same architecture, presumably i86, that you are compiling it on.) A quick glance at the error listing is not enough to let me spot the problem, except to note that all the individual errors reported are the same in character ... the compiler objecting to attempts to cast a variable from a type to the same type ... why the compiler treats that as an error is not immediately apparent to me, to be honest. One other general comment: the move from g++-2.95 to g++-3.02 is causing headaches everywhere, and I don't know which of them your RH system uses (to find out, start with "ls -l /usr/bin/c++" and keep folloing symlinks until you get to a real name). The newest version of avifile is written to work with g++-3.02 and its headers and libraries (libstdc++-5.something_or_other). I'd suggest you try again with the current source, and report any problems you have with it, either here or on the avifile mailing list (avifile@prak.org; join it at the sourceforge site listed above). -- -------------------------------------------"Never tell me the odds!"-------- Ray Olszewski -- Han Solo Palo Alto, California, USA ray@comarre.com ------------------------------------------------------------------------------- - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [SOLVED] Re: File names with spaces 2003-02-23 13:30 ` Theo. Sean Schulze 2003-02-23 14:12 ` Problem installing avi libraries Peter Howell @ 2003-02-23 14:46 ` J. 1 sibling, 0 replies; 24+ messages in thread From: J. @ 2003-02-23 14:46 UTC (permalink / raw) To: linux-newbie On Sun, 23 Feb 2003, Theo. Sean Schulze wrote: > On Fri, Feb 21, 2003 at 09:59:37AM +0100, J. hunted and pecked out: > [snip] > > > > BTW, > > > > please remember that `blank' is a GNU extension, regarding portability > > issues.. etc.. > > > > ~$ man isblank > > > This shouldn't be a problem, since I will only be using it on GNU/Linux. Also, [:blank:] is a character set descriptor for tr. I scanned the source for tr and I don't see any calls to isblank. Should be ok for my limited usage. > > > > p.s. > > Please use a more sane line-wrapping. > > > I wasn't aware that there was a problem with my line wrapping. I have posted to the list a number of times, and you are the first to mention it. I am using mutt with vim as the editor, and it softwraps to the width of the xterm. It doesn't hardwrap at all. What is the problem specifically? Sorry, I dont want to be pedantric. But here your lines are 90 characters long.. Or so long that they run off-screen as in no newlines.. All other messages are displayed correctly. J. - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs ^ permalink raw reply [flat|nested] 24+ messages in thread
* file transfer via telnet 2003-02-20 10:22 ` J. 2003-02-20 17:13 ` [SOLVED] " Theo. Sean Schulze @ 2003-02-21 7:29 ` ichi 2003-02-20 20:10 ` Nathan ` (2 more replies) 1 sibling, 3 replies; 24+ messages in thread From: ichi @ 2003-02-21 7:29 UTC (permalink / raw) To: linux-newbie I year or two back, I remember reading about a way to transfer a file using telnet. It think it involved redirection from one tty to another, but I don't remember the details. I now find myself in a situation with telnet access, but no ftp (or anything else I could use to upload files). Do any of you guys know the telnet method? Cheers, Steven - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: file transfer via telnet 2003-02-21 7:29 ` file transfer via telnet ichi @ 2003-02-20 20:10 ` Nathan 2003-02-20 21:44 ` Eckhardt, Rodolpho H. O. 2003-02-21 8:51 ` J. 2003-02-21 18:55 ` whitnl73 2 siblings, 1 reply; 24+ messages in thread From: Nathan @ 2003-02-20 20:10 UTC (permalink / raw) To: ichi; +Cc: linux-newbie Hi Steven, > I year or two back, I remember reading about a way to transfer > a file using telnet. It think it involved redirection from one > tty to another, but I don't remember the details. I now find > myself in a situation with telnet access, but no ftp (or anything > else I could use to upload files). Do any of you guys know the > telnet method? This might not help, but if you have ssh access you could use scp (secure copy). Regards, Nathan > Cheers, > Steven > > > - > To unsubscribe from this list: send the line "unsubscribe linux-newbie" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.linux-learn.org/faqs > -- I'm as confused as a baby in a topless bar ! -- - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: file transfer via telnet 2003-02-20 20:10 ` Nathan @ 2003-02-20 21:44 ` Eckhardt, Rodolpho H. O. 2003-02-21 8:27 ` Jos Lemmerling 0 siblings, 1 reply; 24+ messages in thread From: Eckhardt, Rodolpho H. O. @ 2003-02-20 21:44 UTC (permalink / raw) To: nate; +Cc: ichi, linux-newbie If I'm not mistaken, you cannot do that because telnet transfers only ASCII caracters or something like that (terminal related caracters)... There isn't a way to tell it to transfer something in binary (like ftp's "binary"). But if you find a way, please e-mail it to me! Best regards, Rodolpho Eckhardt São Paulo - Brazil It´s believed that the following words were said by Nathan: > > Hi Steven, > >> I year or two back, I remember reading about a way to transfer >> a file using telnet. It think it involved redirection from one >> tty to another, but I don't remember the details. I now find >> myself in a situation with telnet access, but no ftp (or anything else I could use >> to upload files). Do any of you guys know the >> telnet method? > > This might not help, but if you have ssh access you could use scp (secure copy). > > Regards, > Nathan > > >> Cheers, >> Steven >> >> >> - >> To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body >> of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the >> FAQ at http://www.linux-learn.org/faqs >> > > -- > > I'm as confused as a baby in a topless bar ! > > -- > > - > To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of > a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ > at http://www.linux-learn.org/faqs -- Rodolpho H. O. Eckhardt reckhardt@mandic.com.br Cel: 11 9126-9107 - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: file transfer via telnet 2003-02-20 21:44 ` Eckhardt, Rodolpho H. O. @ 2003-02-21 8:27 ` Jos Lemmerling 0 siblings, 0 replies; 24+ messages in thread From: Jos Lemmerling @ 2003-02-21 8:27 UTC (permalink / raw) To: linux-newbie On Thu, 20 Feb 2003, Eckhardt, Rodolpho H. O. wrote: > If I'm not mistaken, you cannot do that because telnet transfers only ASCII caracters or > something like that (terminal related caracters)... There isn't a way to tell it to > transfer something in binary (like ftp's "binary"). Isn't there some way to solve this with uudecode and uuencode? I don't know how, but those programs make it possible to transfer binary files over ASCII-only mediums. From the man-page uudecode: Uuencode and uudecode are used to transmit binary files over transmission mediums that do not support other than simple ASCII data. If someone knows *how* to do it, plz let the list know... HTH -- Jos Lemmerling on Debian GNU/Linux jos(@)lemmerling(.nl) - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: file transfer via telnet 2003-02-21 7:29 ` file transfer via telnet ichi 2003-02-20 20:10 ` Nathan @ 2003-02-21 8:51 ` J. 2003-02-21 18:55 ` whitnl73 2 siblings, 0 replies; 24+ messages in thread From: J. @ 2003-02-21 8:51 UTC (permalink / raw) To: linux-newbie On Fri, 21 Feb 2003 ichi@ihug.co.nz wrote: > I year or two back, I remember reading about a way to transfer > a file using telnet. It think it involved redirection from one > tty to another, but I don't remember the details. I now find > myself in a situation with telnet access, but no ftp (or anything > else I could use to upload files). Do any of you guys know the > telnet method? > > Cheers, > Steven Telnet is one of the oldest base proto's arround. So where you want to look is: http://www.rfc-editor.org Start at RFC856 J. - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: file transfer via telnet 2003-02-21 7:29 ` file transfer via telnet ichi 2003-02-20 20:10 ` Nathan 2003-02-21 8:51 ` J. @ 2003-02-21 18:55 ` whitnl73 2003-02-22 9:55 ` Thiago F.G. Albuquerque 2003-02-22 16:03 ` whitnl73 2 siblings, 2 replies; 24+ messages in thread From: whitnl73 @ 2003-02-21 18:55 UTC (permalink / raw) To: ichi; +Cc: linux-newbie On Fri, 21 Feb 2003 ichi@ihug.co.nz wrote: > I year or two back, I remember reading about a way to transfer > a file using telnet. It think it involved redirection from one > tty to another, but I don't remember the details. I now find > myself in a situation with telnet access, but no ftp (or anything > else I could use to upload files). Do any of you guys know the > telnet method? > > Cheers, > Steven > I think that was rsh, not telnet, and man rsh tells the rules for that, in case you have rsh. However, to downoad a file by telnet, capture stdout so: telnet hostname | tee logfile .... uuencode remotefile remotefile exit tr -d "r" < logfile | uudecode Note remotefile is named twice in the uuencode: first is the name it is to be uudecoded to, next is the input to uuencode (uou could use redirection or a pipe instead, by default uuencode operates on stdin. To upload, I guess you could use telnet's ! command, but how exactly excapes me. Lawson -- ---oops--- ________________________________________________________________ Sign Up for Juno Platinum Internet Access Today Only $9.95 per month! Visit www.juno.com - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: file transfer via telnet 2003-02-21 18:55 ` whitnl73 @ 2003-02-22 9:55 ` Thiago F.G. Albuquerque 2003-02-22 10:16 ` J. 2003-02-22 15:59 ` whitnl73 2003-02-22 16:03 ` whitnl73 1 sibling, 2 replies; 24+ messages in thread From: Thiago F.G. Albuquerque @ 2003-02-22 9:55 UTC (permalink / raw) To: linux-newbie >However, to downoad a file by telnet, capture stdout so: > >telnet hostname | tee logfile >.... >uuencode remotefile remotefile >exit >tr -d "r" < logfile | uudecode Ok, I understand. But what is this 'tr -d "r"' for? Thiago - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: file transfer via telnet 2003-02-22 9:55 ` Thiago F.G. Albuquerque @ 2003-02-22 10:16 ` J. 2003-02-22 15:59 ` whitnl73 1 sibling, 0 replies; 24+ messages in thread From: J. @ 2003-02-22 10:16 UTC (permalink / raw) To: linux-newbie On Sat, 22 Feb 2003, Thiago F.G. Albuquerque wrote: > > >However, to downoad a file by telnet, capture stdout so: > > > >telnet hostname | tee logfile > >.... > >uuencode remotefile remotefile > >exit > >tr -d "r" < logfile | uudecode > > Ok, I understand. But what is this 'tr -d "r"' for? > > Thiago He's trying to remove the octal '\015' or '\r' newline terminator. BUT the tr -d 'r' command removes the ascii character 'r' as in octal '\162'. Little mistake.. I guess. This could disrupt potentialy the encode file. references: man ascii B.T.W. tr -d '\015' works also als a DOS to UNIX newline converter. I have it as a handy alias in my .bashrc. alias nodos="tr -d '\015'" nodos < my_msdos_newline.txt > my_unix_newline.txt J. - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: file transfer via telnet 2003-02-22 9:55 ` Thiago F.G. Albuquerque 2003-02-22 10:16 ` J. @ 2003-02-22 15:59 ` whitnl73 1 sibling, 0 replies; 24+ messages in thread From: whitnl73 @ 2003-02-22 15:59 UTC (permalink / raw) To: tfga; +Cc: linux-newbie On Sat, 22 Feb 2003, Thiago F.G. Albuquerque wrote: > > >However, to downoad a file by telnet, capture stdout so: > > > >telnet hostname | tee logfile > >.... > >uuencode remotefile remotefile > >exit > >tr -d "r" < logfile | uudecode > > Ok, I understand. But what is this 'tr -d "r"' for? It is a typo for tr -d "\r" to remove the carriage returns. Most versions of uudecode don't like then, especially on the "end" line. IIRC slackware had a "fromdos" program to do it, but tr works just as well for uuencoded data - there are no control characters in the data itself. tr -d "r" shouldn't trash anything, but it won't do what I wanted it to, either. And I tested the whole thing before I put it in the mail wrong. > > Thiago Lawson -- ---oops--- ________________________________________________________________ Sign Up for Juno Platinum Internet Access Today Only $9.95 per month! Visit www.juno.com - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: file transfer via telnet 2003-02-21 18:55 ` whitnl73 2003-02-22 9:55 ` Thiago F.G. Albuquerque @ 2003-02-22 16:03 ` whitnl73 1 sibling, 0 replies; 24+ messages in thread From: whitnl73 @ 2003-02-22 16:03 UTC (permalink / raw) To: whitnl73; +Cc: ichi, linux-newbie On Fri, 21 Feb 2003 whitnl73@juno.com wrote: > However, to downoad a file by telnet, capture stdout so: > > telnet hostname | tee logfile > .... > uuencode remotefile remotefile > exit > tr -d "r" < logfile | uudecode tr -d "\r" < logfile | uudecode of course. Sorry. Lawson -- ---oops--- ________________________________________________________________ Sign Up for Juno Platinum Internet Access Today Only $9.95 per month! Visit www.juno.com - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: File names with spaces
@ 2003-02-18 9:36 robin
2003-02-18 13:59 ` Jim Reimer
2003-02-28 23:46 ` Mike Castle
0 siblings, 2 replies; 24+ messages in thread
From: robin @ 2003-02-18 9:36 UTC (permalink / raw)
To: linux-newbie
> I am trying to write a bash shell script that
> will translate spaces in file names into
> underline characters. This is the script as I
> have it now:
>
> for file in `ls`
> do
> echo $file
> newfile=`ls ${file} | tr '[:space:]' '[_*]'`
> echo File is named ${file}
> echo The new file is named ${newfile}
> # [[ -s $newfile ]] || (mv $file $newfile)
> sleep 2
> done
A solution should look like this:
for file in `ls -1`; do
newfile=`echo "$file" | sed 's/ /_/'`
echo "File is named ${file}"
echo "The new file is named ${newfile}"
mv "$file" "$newfile"
done
IHMO in the main-loop it is better to choose "ls -1", so the field
separator is \n and there's only one filename in each line.
The next <big> thing is to put the filename into quotations. Now a
filename, even with spaces, will be interpreted as one word.
Hope it helps,
Robin
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: File names with spaces 2003-02-18 9:36 File names with spaces robin @ 2003-02-18 13:59 ` Jim Reimer 2003-02-28 23:46 ` Mike Castle 1 sibling, 0 replies; 24+ messages in thread From: Jim Reimer @ 2003-02-18 13:59 UTC (permalink / raw) To: robin; +Cc: linux-newbie robin@robind.de wrote: > > A solution should look like this: > > for file in `ls -1`; do > newfile=`echo "$file" | sed 's/ /_/'` > echo "File is named ${file}" > echo "The new file is named ${newfile}" > > mv "$file" "$newfile" > done > > IHMO in the main-loop it is better to choose "ls -1", so the field > separator is \n and there's only one filename in each line. > The next <big> thing is to put the filename into quotations. Now a > filename, even with spaces, will be interpreted as one word. Robin, that still doesn't work right - try it and see: $echo > file\ 001 $echo > file\ 002 $ ./test.sh File is named file The new file is named file File is named 001 The new file is named 001 File is named file The new file is named file File is named 002 The new file is named 002 $ The previously referenced Bash Scripting Guide has the answer. Change the for statement to read: for file in *; do and it will work. $ ./test.sh File is named file 001 The new file is named file_001 File is named file 002 The new file is named file_002 $ -jdr- - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: File names with spaces 2003-02-18 9:36 File names with spaces robin 2003-02-18 13:59 ` Jim Reimer @ 2003-02-28 23:46 ` Mike Castle 1 sibling, 0 replies; 24+ messages in thread From: Mike Castle @ 2003-02-28 23:46 UTC (permalink / raw) To: linux-newbie In article <20030218093623.1FB578D8FE@basicbox3.server-home.net>, <robin@robind.de> wrote: >for file in `ls -1`; do > newfile=`echo "$file" | sed 's/ /_/'` > echo "File is named ${file}" > echo "The new file is named ${newfile}" > > mv "$file" "$newfile" >done > >IHMO in the main-loop it is better to choose "ls -1", so the field >separator is \n and there's only one filename in each line. ls should detect that stdout is not a terminal and fall back to -1 automatically. Granted, it can't hurt, but should be unnecessary. However, a few comments. First, why use ls at all? Might as well use: for file in *; do Of course, since you are only interested in files with spaces in them, while not limit to that in the first place? mcastle@dl-mcastle[03:37pm]~/foo(776) for file in *; do echo $file; done a b bar mcastle@dl-mcastle[03:37pm]~/foo(777) for file in *\ *; do echo $file; done a b Of course, if you have a lot of files, this technique simply doesn't work as you'll overflow your max command line length. You could go back to: ls | while read; do But you're processing every file again. Another alternative might be something like: find -name '* *' -maxdepth 1 I think maxdepth is gnu find specific, so keep that in mind (I don't have access to any non-gnu systems to test). >The next <big> thing is to put the filename into quotations. Now a >filename, even with spaces, will be interpreted as one word. Not just quotes, but prepend ./ too, in case any of your file names look like "- -" mcastle@dl-mcastle[03:45pm]~/foo(793) find . ./bar ./a b ./blah ./blah/c d ./ns ./- - mcastle@dl-mcastle[03:45pm]~/foo(794) ./ns `././a b' -> `././a_b' `././- -' -> `././-_-' mcastle@dl-mcastle[03:45pm]~/foo(795) cat ns #!/bin/bash find -name '* *' -maxdepth 1 | while read name; do newname=$(echo $name | tr ' ' '_') mv -iv "./$name" ./$newname done Heh... forgot that find will already add in the ./ ... clean up as appropriate. mrc -- Mike Castle dalgoda@ix.netcom.com www.netcom.com/~dalgoda/ We are all of us living in the shadow of Manhattan. -- Watchmen fatal ("You are in a maze of twisty compiler features, all different"); -- gcc - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs ^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2003-02-28 23:46 UTC | newest] Thread overview: 24+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2003-02-17 19:11 File names with spaces Theo. Sean Schulze 2003-02-17 20:34 ` Brian Jackson 2003-02-18 21:37 ` Theo. Sean Schulze 2003-02-20 10:22 ` J. 2003-02-20 17:13 ` [SOLVED] " Theo. Sean Schulze 2003-02-20 19:43 ` J. 2003-02-21 8:59 ` J. 2003-02-23 13:30 ` Theo. Sean Schulze 2003-02-23 14:12 ` Problem installing avi libraries Peter Howell 2003-02-23 15:25 ` Ray Olszewski 2003-02-23 14:46 ` [SOLVED] Re: File names with spaces J. 2003-02-21 7:29 ` file transfer via telnet ichi 2003-02-20 20:10 ` Nathan 2003-02-20 21:44 ` Eckhardt, Rodolpho H. O. 2003-02-21 8:27 ` Jos Lemmerling 2003-02-21 8:51 ` J. 2003-02-21 18:55 ` whitnl73 2003-02-22 9:55 ` Thiago F.G. Albuquerque 2003-02-22 10:16 ` J. 2003-02-22 15:59 ` whitnl73 2003-02-22 16:03 ` whitnl73 -- strict thread matches above, loose matches on Subject: below -- 2003-02-18 9:36 File names with spaces robin 2003-02-18 13:59 ` Jim Reimer 2003-02-28 23:46 ` Mike Castle
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox