foreach
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > foreach




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    foreach  
Mehlwurm


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-08-06 12:26 PM

hi,

i have some trouble getting a loop started

foreach i (`cat liste.txt`)
rm $i
end

foreach: No Match.

what am i doing wrong?
liste.txt is a file which contains filenames in the directory .. all
rights are set, but it doesn=B4t work






[ Post a follow-up to this message ]



    Re: foreach  
Mehlwurm


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-08-06 12:26 PM

i am so sorry

it was my fault

the first line in liste.txt was empty ...

SORRY






[ Post a follow-up to this message ]



    Re: foreach  
Maurizio Loreti


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-08-06 12:26 PM

"Mehlwurm" <mehlwurm@rocketmail.com> writes:

> hi,
>
> i have some trouble getting a loop started
>
> foreach i (`cat liste.txt`)
> rm $i
> end
>
> foreach: No Match.
>
> what am i doing wrong?

what tells "echo $SHELL" ?  maybe /bin/bash ?

--
Maurizio Loreti                         [url]http://www.pd.infn.it/~loreti/mlo.html[/ur
l]
Dept. of Physics, Univ. of Padova, Italy              ROT13: ybergv@cq.vasa.
vg





[ Post a follow-up to this message ]



    Re: foreach  
Ralf Fassel


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-08-06 12:26 PM

* "Mehlwurm" <mehlwurm@rocketmail.com>
| the first line in liste.txt was empty ...

If you have 'sane' filenames in liste.txt you could also simply go

rm -f `cat liste.txt`

R'





[ Post a follow-up to this message ]



    Re: foreach  
Mehlwurm


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-09-06 12:24 PM

@Ralf
THX :-)

@ Mairizio
I am using the csh
and there is no other one installed ;-)






[ Post a follow-up to this message ]



    Re: foreach  
Ralf Fassel


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-09-06 12:24 PM

* "Mehlwurm" <mehlwurm@rocketmail.com>
| I am using the csh
| and there is no other one installed ;-)

A Unix with no /bin/sh, or /bin/ksh?
Strange that it works at all...

R'





[ Post a follow-up to this message ]



    Re: foreach  
Chris F.A. Johnson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-10-06 12:23 AM

On 2006-06-09, Mehlwurm wrote:
> @Ralf
> THX :-)
>
> @ Mairizio
> I am using the csh
> and there is no other one installed ;-)

There is no modern Unix system without /bin/sh (except perhaps some
minimal or embeded installations). Most wouldn't run without it.

What are you using?


--
Chris F.A. Johnson, author              <http://cfaj.freeshell.org>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence





[ Post a follow-up to this message ]



    Re: foreach  
Mehlwurm


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-12-06 06:30 AM

Chris F.A. Johnson schrieb:

>
>    What are you using?
>=20
>=20

a true64 with a sh but linked to csh .. it wasn=B4t my idea ;-)






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:45 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register