I'll give a warning that I can't write a script for nuts, but can usually work out what one does (unless your talking things like
cut -f 1-8 -d '|'`, and cut -f 10-13 -d '|'`, and sed -e 's%^,%%' | tr ',' '\n' | sort -u | tr '\n' ',' | sed -e 's%,$%%', where you loose me as soon as you start!).
thanks
scsijon
What I need to start with is create a script or two to do these functions>
Code: Select all
#!/bin/sh
#script1
# I NEED TO CHECK IF A "FILE" IS A LINK OR NOT
# if /opt/packagenamedirectory/fileorlinkname ISNOT a LINK
# OR IF IT IS AN XML FILE
# then if /opt/packagenamedirectory/fileorlinkname ISNOT a XMLFILE
# OR IF IT'S NOT A TEXT FILE
# then if /opt/packagenamedirectory/fileorlink ISNOT a TEXTFILE
# then "GIVE_A_SCREEN_ERROR_SPLASH" with /opt/packagenamedirectory/fileorlink
# AND the SCRIPT_NAME
# AND await close of splash screen before continuing
# IF IT'S A TEXT FILE IT SHOULDN'T BE IT SHOULD BE A LINK SO FIX IT
# else delete /opt/packagenamedirectory/fileorlink
# AND ln -s /opt/packagenamedirectory2/filename /opt/packagenamedirectory/linkname
# fi
# fi
# IF IT IS A XML FILE IT MAY NEED WORK
# else goto script3
# fi
# IF IT'S A LINK CHECK IT'S THE RIGHT ONE
# else goto script2
# fi
Code: Select all
#!/bin/sh
#script2
# if /opt/packagenamedirectory/fileorlinkname ISNOT_LINKED_TO /opt/packagenamedirectory2/a_particular_linkname
# then DELETE /opt/packagenamedirectory/fileorlinkname
# AND ln -s /opt/packagenamedirectory2/filename /opt/packagenamedirectory/linkname
# if /opt/packagenamedirectory/fileorlinkname ISNOT_LINKED_TO /opt/packagenamedirectory2/a_particular_linkname
# then DELETE /opt/packagenamedirectory/fileorlinkname
# AND ln -s /opt/packagenamedirectory2/filename /opt/packagenamedirectory/linkname
# if /opt/packagenamedirectory/fileorlinkname ISNOT_LINKED_TO /opt/packagenamedirectory2/a_particular_linkname
# then DELETE /opt/packagenamedirectory/fileorlinkname
# AND ln -s /opt/packagenamedirectory2/filename /opt/packagenamedirectory/linkname
# if /opt/packagenamedirectory/fileorlinkname ISNOT_LINKED_TO /opt/packagenamedirectory2/a_particular_linkname
# then DELETE /opt/packagenamedirectory/fileorlinkname
# AND ln -s /opt/packagenamedirectory2/filename /opt/packagenamedirectory/linkname
# fi
# fi
# fi
# fi
Code: Select all
#!/bin/sh
#script3
# this script will contain a number of additions/changes to the xml filesets
# it is not yet worked out what will be in each of them!
# if_the_filename_is/opt/packagenamedirectory/xmlfilename1
# then goto DO_THESE_CHANGES1
# if_the_filename_is/opt/packagenamedirectory/xmlfilename2
# then DO_THESE_CHANGES2
# if_the_filename_is/opt/packagenamedirectory/xmlfilename3
# then DO_THESE_CHANGES3
# if_the_filename_is/opt/packagenamedirectory/xmlfilename4
# then DO_THESE_CHANGES4
# if_the_filename_is/opt/packagenamedirectory/xmlfilename5
# then DO_THESE_CHANGES5
# none or a mixed number of changes may be needed
# fi
# fi
# fi
# fi
# fi
#
# DO_THESE_CHANGES1
# the changes??
# return
#
# DO_THESE_CHANGES2
# the changes??
# return
#
# DO_THESE_CHANGES3
# the changes??
# return
#
# DO_THESE_CHANGES4
# the changes??
# return
#
# DO_THESE_CHANGES5
# the changes??
# return