TIP: Click on subject to list as thread! ANSI
echo: linux_bbs
to: Gert Koefoed Andersen
from: Wilfred van Velzen
date: 2010-12-10 11:13:22
subject: Re: Some linux code co commands

Hi,

On 09 Dec 10 23:10, Gert Koefoed Andersen wrote to All:
  about: "Some linux code co commands":

 GKA> In linux I have this command and functions in mind nad use.

 GKA> ---snip---
 GKA> if [ -a nodelist.${num} ]; then goto latest; fi
 GKA>    else
 GKA>     cp nodelist.${oldnum} /home/fido/makenl/z115fake/
 GKA> goto chckfile

 GKA> :latest
 GKA> cp nodelist.${num} /home/fido/makenl/z115fake/

 GKA> :chckfile
 GKA> ####
 GKA> # some other linux command and functions for check and move files here
 GKA> under.
 GKA> ---snip---

You don't need to use goto's in linux shell so do something like this:

if [ -a nodelist.${num} ]; then
  cp nodelist.${num} /home/fido/makenl/z115fake/
else
  cp nodelist.${oldnum} /home/fido/makenl/z115fake/
fi

####
# some other linux command and functions for check and move files here under.


 GKA> The linux command and function shall could check if the new julian
 GKA> dat
 GKA> nodelist/pasnlist is copied to a place and if it not is the julian day file
 GKA> then jump to another section and copy the latest there is, but if it there
 GKA> is the julian day file cp it and jump over the section for the old file
 GKA> copy.

 GKA> it could maybe just be done with 2 line of if statements.
 GKA> if [ -a nodelist.${oldnum ]; then copy nodelist.${oldnum}; fi
 GKA> if [ -a nodelist.${num} ]; then copy nodelist.${num}; fi

Ok, except for copy -> cp and you forgot the destination of the copy! ;)

 GKA> so the function only copy the old nodelist when it not find the
 GKA> julian fay
 GKA> nodelist there will be the next weeks nodelist.


Bye, Wilfred.


--- FMail/Win32 1.62.GPL
* Origin: Amiga Offline BBS Lisse (2:280/464)
SEEN-BY: 3/0 633/267 640/954 712/0 313 550 848
@PATH: 280/464 5003 2432/200 772/1 140/1 261/38 712/848 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.