Re: [JSch-users] problem with executing a fairly complex command
Status: Alpha
Brought to you by:
ymnk
From: Holger K. <in...@kl...> - 2004-10-22 16:07:22
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday 22 October 2004 16:17, Wojciech Biela wrote: > yeah .. with the help of another jsch user (Christian) I got that .. of > another question then .. it works now but it fails on files with > whitespaces in filenames > > now I use: > > $ cd tmp; for i in `ls *.gpg | grep -v ^OLD_` ; do mv "$i" "NEW_$i"; done > > e.g. there is a file "file with whitespace.gpg" in the directory .. and > the result is : This is a general shortcoming of the 'for' command in bash/sh. You should create a different kind of loop. Untested example: ls *.gpg | grep -v '^OLD_' | while read i; do mv "$i" "NEW_$i"; done Mit freundlichem Gru=C3=9F / With kind regards Holger Klawitter =2D -- in...@kl... =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQFBeSsm1Xdt0HKSwgYRAoxLAJ4m7dygngIuZm5adGLvJzFP94Q/BgCdHEx/ Qo2HTMhYxgRKC/FqfxdEdwc=3D =3DtRhh =2D----END PGP SIGNATURE----- |