Converting Linux bash shell Journal Script to Windows VB or whatever for documentation

Joined
May 22, 2010
Messages
2,079
I want to convert the Journal Bash Shell Script my professor told me I could continue using after graduation or whatever to Microsoft Visual Basic or whatever scripting language Windows uses for documentation purposes. The problem is that I'm not sure if the commands I choose are compatible or equivalent, so I don't know if the script will do what I think it might do because I haven't test it. Also I need to make a list of the commands or options in the script to help remember how to use it, but that's another problem. What's keeping me from doing this is that I don't have a working windows system with me at all times or often enough to test it on because I'm running Ubuntu Linux on my Laptop PC and my Mac Book Pro is having issues with both Mac OS X and Windows 7 being used through boot camp. Therefore, I can only use wine in Linux to test it, so I don't know if I'll get the desired results I'm looking for. Can anyone help me with testing or figuring this out, so I can take my professors brilliant script and use it to document on Windows because I have no problem using the script in Mac OS X except that I can't use aliases and I have to be root to run it. I will post the code I have for the original script in a reply next.
 
Last edited:
I want to convert the Journal Bash Shell Script my professor told me I could continue using after graduation or whatever to Microsoft Visual Basic or whatever scripting language Windows uses for documentation purposes. The problem is that I'm not sure if the commands I choose are compatible or equivalent, so I don't know if the script will do what I think it might do because I haven't test it. Also I need to make a list of the commands or options in the script to help remember how to use it, but that's another problem. What's keeping me from doing this is that I don't have a working windows system with me at all times or often enough to test it on because I'm running Ubuntu Linux on my Laptop PC and my Mac Book Pro is having issues with both Mac OS X and Windows 7 being used through boot camp. Therefore, I can only use wine in Linux to test it, so I don't know if I'll get the desired results I'm looking for. Can anyone help me with testing or figuring this out, so I can take my professors brilliant script and use it to document on Windows because I have no problem using the script in Mac OS X except that I can't use aliases and I have to be root to run it. I post the code I have for the original script in a reply next.

Here is the code for the bash script:

#!/bin/bash

## Create this shell script modifying it and including supplied parts

### Personal directory/course settings
FULLNAME="Full Name"
USERNAME="username" # Username on your (local) system
LINUXSSUSERNAME="Linuxserveruser" # Username on linux.starkstate.net
LOCALSRVHOMEDIR="/home/username" # Home directory on your (local) server
LINUXSSDIRECTORY=/home/students/12345/linuxserverusername# Home directory on linux.starksate.net
INDEX="12345" # Also the CRN Number
TUXIMAGE=tux-network.jpg # Choose the appropriate image from /labs/tux
# and place in your journal directory

### Set variables, be sure to change the variables to match your system
SCRIPT="$0"
LABNUM="$1"
ENTRYTYPE="$2"
FILENAME="$3"
ARG3="$3"
ARG4="$4"
ARG5="$5"
LAST=`echo $LINUXSSUSERNAME | cut -c2-5`
FIRST=`echo $LINUXSSUSERNAME | cut -c1`
JOURNALDATE=`date` # date/time of the journal entry
TMPFILE="/tmp/journal.$$"
JOURNALDIR="${LOCALSRVHOMEDIR}/journal" # Change to your directory
JOURNALFILE="$JOURNALDIR/$INDEX.$LAST.$FIRST.$lab_$LABNUM.journal.html"
JOURNALFUNCTIONS="${LOCALSRVHOMEDIR}/bin/journal_functions.bash" # set this file
VALIDOPTIONS="--new|-d|-e|-j|--list|--log|-r|-s|-p|-u|-v"

############ start - TESTS ############

if [ $# -lt 2 ]
then
echo "USAGE: $0 lab# $VALIDOPTIONS [ARG3] [ARG4]"
echo " ARG3 is filename or printername or title"
echo " ARG4 is original(backupfile) or number of lines to list"
echo " [--new] Use to start a new journal entry "
echo " ARG3 is the Title of the lab"
echo " [-d|--diff|--config] Show differences between "
echo " configuration file (ARG4 required)"
echo " Argument #4 is the backup file"
echo " backupfile is backup version of the config file"
echo " use /dev/null if a newly created config file"
echo " [-e|--edit|--open] Open the file in vi for editing"
echo " [-j|--journal] Journal Entry (personal comments, insertion)"
echo " [--list] Show all lines from a shell script or file"
echo " [--log] Show lines from a log file (ARG4 required)"
echo " ARG4 must be a numeric value"
echo " [-r|-s|--read|--stdin|--cmd] read from STDIN "
echo " (use to capture output of commands in journal)"
echo " ARG3 must be the personal journal entry "
echo " describing the contents of listing"
echo " [-u|--upload] Send the file directly to the print "
echo " (requires html2ps to be installed)"
echo " [-p|--print] Send the file directly to the print "
echo " (requires html2ps to be installed)"
echo " ARG3 is an optional printer to send "
echo " the printout to"
echo " [-v|--view] Open the file in the konqueror "
echo " web browser for viewing"
echo " [--spell] Run a spell check on the file"

exit 66
fi

if [ ! -d "$JOURNALDIR" ]
then
echo "$JOURNALDIR is not a valid directory, you must create it"
exit 67
fi

if [ ! -e "$JOURNALFILE" -a "$ENTRYTYPE" != "--new" ]
then
echo -e "$JOURNALFILE does not exist, create it with --new\n\n"; $SCRIPT
exit 68
fi

############ end - TESTS ############

## Use the source command to source in the file journal_functions.bash
## that is supplied by the instructor
. $JOURNALFUNCTIONS


### Determine if a configuration, or log file
### and call the appropriate function

case "$ENTRYTYPE" in
--new) # new journal entry
if [ -e $JOURNALFILE ]
then
echo "File already exists"
$SCRIPT
exit 77
fi
if [ ! "$ARG3" ]
then
echo "Need to Give the new journal a title"
$SCRIPT
exit 70
fi
new_journal "$ARG3"
;;
-d|--diff|--config)
config
;;
-j|--journal)
journal_entry "Journal_Entry"
;;
--log)
log
;;
--list)
list
;;
--spell)
spell_check
;;
-p|--print)
if [ "$ARG3" ]
then
ARG3="-P $ARG3" # add -P to print to specified printer
fi
cat $JOURNALFILE >/tmp/p.$$.html
echo "<BR>Printed on `date`</BODY></HTML>" >>/tmp/p.$$.html
html2ps /tmp/p.$$.html | lpr $ARG3
# rm /tmp/p.$$.html
lpq -a
exit 0;
;;
-r|-s|--read|--stdin|--cmd)
if [ ! "$ARG3" ]
then
echo "####################################################"
echo -e "\n\nAdd journal entry to end of command\n\n"
echo "####################################################"
$0
exit
fi

readin
;;
-u|--upload)
upload_journal
exit 0;
;;
-v|--view)
if [ "$ARG3" ]
then
$ARG3 $JOURNALFILE >/dev/null 2>&1 &
else
konqueror $JOURNALFILE >/dev/null 2>&1 &
fi
exit
;;
-e|--edit|--open)
vi $JOURNALFILE
exit
;;

*)
echo -e "\n\n Invalid Option \n\n"
$0 | less
esac
echo "<BR><FONT size=-2>`date +%H:%M:%S` ### ${LINUXSSUSERNAME}</FONT><HR>" >> $TMPFILE
echo " " >> $TMPFILE
cat $TMPFILE | fmt -s >>$JOURNALFILE
rm -f $TMPFILE # comment this line out for testing
chown $USERNAME $JOURNALFILE 2>/dev/null # Make sure owned my default user

ls -lG $JOURNALFILE
 
I want to convert the Journal Bash Shell Script my professor told me I could continue using after graduation or whatever to Microsoft Visual Basic or whatever scripting language Windows uses for documentation purposes. The problem is that I'm not sure if the commands I choose are compatible or equivalent, so I don't know if the script will do what I think it might do because I haven't test it. Also I need to make a list of the commands or options in the script to help remember how to use it, but that's another problem. What's keeping me from doing this is that I don't have a working windows system with me at all times or often enough to test it on because I'm running Ubuntu Linux on my Laptop PC and my Mac Book Pro is having issues with both Mac OS X and Windows 7 being used through boot camp. Therefore, I can only use wine in Linux to test it, so I don't know if I'll get the desired results I'm looking for. Can anyone help me with testing or figuring this out, so I can take my professors brilliant script and use it to document on Windows because I have no problem using the script in Mac OS X except that I can't use aliases and I have to be root to run it. I post the code I have for the original script in a reply next.

Here is the journal.bash_functions script:


## FUNCTIONS for journal.sh

function new_journal()
{
echo "<HTML><HEAD><TITLE>$1 $FULLNAME</TITLE></HEAD><BODY>" >>$TMPFILE
cat >>$TMPFILE <<NEW_JOURNAL
<TABLE width=95%><TR>
<TD><img src=${TUXIMAGE} width="70" height="70"></TD>
<TD width=20%>lab #<B>$LABNUM</B><TD>
<TH align=center>$FILENAME</TH>
<TH align=right with=20%>$FULLNAME<BR>$INDEX</TH>
<TR></TABLE>
describe the purpose of the lab here (use 'C' to change line)
NEW_JOURNAL
vi +/describe $TMPFILE
} # end function new_journal ()

### Create user journal entry
function journal_entry ()
{
## Change to your name
mv -f $TMPFILE $TMPFILE.1
echo -e "\n\n<h3>$*</h3>" >> $TMPFILE
echo "on <B>$JOURNALDATE</B>" >> $TMPFILE
echo " by <B>$FULLNAME</B><BR>" >> $TMPFILE
echo "<BR>" >> $TMPFILE
echo " describe changes here('C' to change line)" >> $TMPFILE
## echo "</PRE>" >> $TMPFILE
cat $TMPFILE $TMPFILE.1 >$TMPFILE.2
mv -f $TMPFILE.2 $TMPFILE
vi +/describe $TMPFILE
}

function upload_journal ()
{
scp -p ${JOURNALFILE} ${LINUXSSUSERNAME}@linux.starkstate.net:${LINUXSSDIRECTORY}/journal/
}

function configdiff()
{
diff $1 $2 | sed "s/</\&lt;/g" | sed "s/>/\&gt;/g"
}

function config()
{ ## this is a configuration file, get listing and differences

if [ ! -e "$ARG4" ]
then
clear;
echo "Configuration file needs a backup file!"
echo " use /dev/null if the config file was just created"
echo " always use cp -p when making backup file"
echo ""
$SCRIPT
exit 67
fi
MODTIME=`ls -ld $FILENAME | awk '{print $6, $7, $8}'`
echo "<BR><pre>" >> $TMPFILE
ls -ldrt $FILENAME* $ARG4 | uniq >> $TMPFILE
echo "</pre>" >> $TMPFILE
echo "<TABLE border=1><tr><td align=center>" >> $TMPFILE
echo "Diff of <B>$FILENAME</B> and <B>$ARG4</B><BR></td></tr><tr><TD><PRE>" >> $TMPFILE
configdiff $FILENAME $ARG4 >> $TMPFILE
echo "</PRE></TD></TR></TABLE>" >> $TMPFILE

journal_entry Configuration file $FILENAME
}

function log()
{

if [ ! $ARG4 ]
then
$SCRIPT
exit 68
fi
ls -ldG $FILENAME >>$TMPFILE
MODTIME=`ls -ld $FILENAME | awk '{print $6, $7, $8}'`
echo "<br /><br />### Listing of last <B>$ARG4</B> lines of logfile <B>$FILENAME</B> modified on <B>$MODTIME</B><BR><TABLE border=1><TR><TD><PRE>" >> $TMPFILE
tail -$ARG4 ${FILENAME} >> $TMPFILE
echo -e "</PRE></TD></TR></TABLE>\n\n" >> $TMPFILE
journal_entry LOG file $FILENAME
}
function readin ()
{ # read in from stdin into journal
READINFILE=/tmp/readin.$$
cat > ${READINFILE}
echo -e "\n\n <TABLE width=95%><TR><TD><B>Output of command<B> on `date`<BR></TD></TR><TR><TD><PRE>\n" >> $TMPFILE
echo -e "${ARG3}\n<BR></PRE></TR></TD></TABLE><TABLE border=1><TR><TD><PRE>" >>$TMPFILE
cat ${READINFILE} >>$TMPFILE
echo "</PRE></TD></TR></TABLE>" >>$TMPFILE

}

function list()
{

echo "<BR>" >>$TMPFILE
ls -ldG $FILENAME >>$TMPFILE
MODTIME=`ls -ld $FILENAME* | awk '{print $6, $7, $8}'`
echo "<TABLE width=95%><TR><TD>Listing of <B>$FILENAME</B> modified on <B><br />$MODTIME</B><BR></TD></TR></TABLE><TABLE border=1><TR><TD><PRE>" >> $TMPFILE
cat ${FILENAME} >> $TMPFILE
echo "</PRE></TD></TR></TABLE>" >> $TMPFILE
journal_entry Listing of file $FILENAME
}

function spell_check()
{
aspell -c $JOURNALFILE
}
 
I want to convert the Journal Bash Shell Script my professor told me I could continue using after graduation or whatever to Microsoft Visual Basic or whatever scripting language Windows uses for documentation purposes. The problem is that I'm not sure if the commands I choose are compatible or equivalent, so I don't know if the script will do what I think it might do because I haven't test it. Also I need to make a list of the commands or options in the script to help remember how to use it, but that's another problem. What's keeping me from doing this is that I don't have a working windows system with me at all times or often enough to test it on because I'm running Ubuntu Linux on my Laptop PC and my Mac Book Pro is having issues with both Mac OS X and Windows 7 being used through boot camp. Therefore, I can only use wine in Linux to test it, so I don't know if I'll get the desired results I'm looking for. Can anyone help me with testing or figuring this out, so I can take my professors brilliant script and use it to document on Windows because I have no problem using the script in Mac OS X except that I can't use aliases and I have to be root to run it. I post the code I have for the original script in a reply next.

Here is the code for Journal.exe using vb:

'Program modified for WIndows by: My Name'
'Date: Aug 13, 2015'
'Program name: Journal.exe'

Module Module1

Sub Main()

'#!/bin/bash'

'Create this shell script modifying it and including supplied parts'

'personal directory/course settings'
Dim FULLNAME As String = "Bob Jones"
Dim USERNAME As String ="bob" # Username on your (local) system
Dim WINDOWSSSUSERNAME As String ="Clientusername" # Username on linux.starkstate.net
Dim LOCALSRVHOMEDIR As String ="\Users\Clientusername\" # Home directory on your (local) server
Dim WINDOWSSSDIRECTORY As String =/home/students/12345/serverusername # Home directory on linux.starksate.net
Dim INDEX As String ="12345" # Also the CRN Number
Dim TUXIMAGE As String =tux-network.jpg # Choose the appropriate image from /labs/tux
# and place in your journal directory

'Set variables, be sure to change the variables to match your system'
Dim SCRIPT As String = "$0"
Dim LABNUM As String = "$1"
Dim ENTRYTYPE As String = "$2"
Dim FILENAME As String = "$3"
Dim ARG3 As String = "$3"
Dim ARG4 As String = "$4"
Dim ARG5 As String = "$5"
Dim LAST As Object =`echo $WINDOWSSSUSERNAME | cut -c2-5`
Dim FIRST As Object =`echo $WINDOWSSSUSERNAME | cut -c1`
Dim JOURNALDATE As Object =`date` # date\time of the journal entry
Dim TMPFILE As String = "\temp\journal.$$"
Dim JOURNALDIR As String ="${LOCALSRVHOMEDIR}\journal" # Change to your directory
Dim JOURNALFILE As String = "$JOURNALDIR\$INDEX.$LAST.$FIRST.$lab_$LABNUM.journal.html"
Dim JOURNALFUNCTIONS As String ="${LOCALSRVHOMEDIR}\Users\IsItY2kCorei7\journal_functions.vbs" # set this file
Dim VALIDOPTIONS As String = "--new|-d|-e|-j|--list|--log|-r|-s|-p|-u|-v"

'''''''''''' start - TESTS ''''''''''''

If [ $# -lt 2 ]
Then
echo "USAGE: $0 lab# $VALIDOPTIONS [ARG3] [ARG4]"
echo " ARG3 is filename or printername or title"
echo " ARG4 is original(backupfile) or number of lines to list"
echo " [--new] Use to start a new journal entry "
echo " ARG3 is the Title of the lab"
echo " [-d|--diff|--config] Show differences between "
echo " configuration file (ARG4 required)"
echo " Argument #4 is the backup file"
echo " backupfile is backup version of the config file"
echo " use /dev/null if a newly created config file"
echo " [-e|--edit|--open] Open the file in vi for editing"
echo " [-j|--journal] Journal Entry (personal comments, insertion)"
echo " [--list] Show all lines from a shell script or file"
echo " [--log] Show lines from a log file (ARG4 required)"
echo " ARG4 must be a numeric value"
echo " [-r|-s|--read|--stdin|--cmd] read from STDIN "
echo " (use to capture output of commands in journal)"
echo " ARG3 must be the personal journal entry "
echo " describing the contents of listing"
echo " [-u|--upload] Send the file directly to the print "
echo " (requires html2ps to be installed)"
echo " [-p|--print] Send the file directly to the print "
echo " (requires html2ps to be installed)"
echo " ARG3 is an optional printer to send "
echo " the printout to"
echo " [-v|--view] Open the file in the konqueror "
echo " web browser for viewing"
echo " [--spell] Run a spell check on the file"

exit 66
End If

If [ ! -d "$JOURNALDIR" ]
Then
echo "$JOURNALDIR is not a valid directory, you must create it"
exit 67
End If

If [ ! -e "$JOURNALFILE" -a "$ENTRYTYPE" != "--new" ]
Then
echo "$JOURNALFILE does not exist, create it with --new\n\n"; $SCRIPT
exit 68
End If

'end - TESTS'

'Use the source command to source in the file journal_functions.bash'
'that is supplied by the instructor'
. $JOURNALFUNCTIONS


'Determine if a configuration, or log file'
'and call the appropriate function'

case "$ENTRYTYPE" in
--new) # new journal entry

If [ -e $JOURNALFILE ]
Then
echo "File already exists"
$SCRIPT
exit 77
End If
If [ ! "$ARG3" ]
Then
echo "Need to Give the new journal a title"
$SCRIPT
exit 70
End If
new_journal "$ARG3"
;;
-d|--dIff|--config)
config()
;;
-j|--journal)
journal_entry "Journal_Entry"
;;
--log)
log()
;;
--list)
List()
;;
--spell)
spell_check()
;;
-p|--print)
if [ "$ARG3" ]
Then
ARG3="-P $ARG3" # add -P to print to specified printer
End If
type $JOURNALFILE >\temp\p.$$.html
echo "<BR>Printed on `date`</BODY></HTML>" >>\temp\p.$$.html
html2ps \temp\p.$$.html | lpr $ARG3
# del \temp\p.$$.html
lpq -a
exit 0;
;;
-r|-s|--read|--stdin|--cmd)
If [ ! "$ARG3" ]
Then
echo "''''''''''''''''''''''''''''''''''''''''''''''''''''"
echo -e "\n\nAdd journal entry to end of command\n\n"
echo "''''''''''''''''''''''''''''''''''''''''''''''''''''"
$0
exit
End If

readin()
;;
-u|--upload)
upload_journal()
exit 0;
;;
-v|--view)
If [ "$ARG3" ]
Then
$ARG3 $JOURNALFILE > NUL 2>&1 &
Else
konqueror $JOURNALFILE > NUL 2>&1 &
End If
exit
;;
-e|--edit|--open)
vi $JOURNALFILE
exit
;;

*)
echo -e "\n\n Invalid Option \n\n"
$0 | more
esac()
echo "<BR><FONT size=-2>`date +%H:%M:%S` ### ${WINDOWSSSUSERNAME}</FONT><HR>" >> $TMPFILE
echo " " >> $TMPFILE
type $TMPFILE | fmt -s >>$JOURNALFILE
DEL /F $TMPFILE ' comment this line out for testing
chown $USERNAME $JOURNALFILE 2>/dev/null # Make sure owned my default user

dir /N /A:D $JOURNALFILE




End Sub

End Module
 
I want to convert the Journal Bash Shell Script my professor told me I could continue using after graduation or whatever to Microsoft Visual Basic or whatever scripting language Windows uses for documentation purposes. The problem is that I'm not sure if the commands I choose are compatible or equivalent, so I don't know if the script will do what I think it might do because I haven't test it. Also I need to make a list of the commands or options in the script to help remember how to use it, but that's another problem. What's keeping me from doing this is that I don't have a working windows system with me at all times or often enough to test it on because I'm running Ubuntu Linux on my Laptop PC and my Mac Book Pro is having issues with both Mac OS X and Windows 7 being used through boot camp. Therefore, I can only use wine in Linux to test it, so I don't know if I'll get the desired results I'm looking for. Can anyone help me with testing or figuring this out, so I can take my professors brilliant script and use it to document on Windows because I have no problem using the script in Mac OS X except that I can't use aliases and I have to be root to run it. I post the code I have for the original script in a reply next.

Here is the code for the journal.functions.exe using vb:

'Program modified by My Name'
'Date: Aug 13, 2015'
'Program name JournalFunctions.exe'


Module Module1

Sub Main()

'FUNCTIONS for journal.sh'

Public new_journal()
{
echo "<HTML><HEAD><TITLE>$1 $FULLNAME</TITLE></HEAD><BODY>" >>$TMPFILE
type >>$TMPFILE <<NEW_JOURNAL
<TABLE width=95%><TR>
<TD><img src=${TUXIMAGE} width="70" height="70"></TD>
<TD width=20%>lab #<B>$LABNUM</B><TD>
<TH align=center>$FILENAME</TH>
<TH align=right with=20%>$FULLNAME<BR>$INDEX</TH>
<TR></TABLE>
describe the purpose of the lab here (use 'C' to change line)
new_journal()
notepad.exe +/describe $TMPFILE
}

End Function () 'End of new_journal function'

'Create user journal entry'
Public journal_entry()
{
## Change to your name
move /Y $TMPFILE $TMPFILE.1
echo "\n\n<h3>$*</h3>" >> $TMPFILE
echo "on <B>$JOURNALDATE</B>" >> $TMPFILE
echo " by <B>$FULLNAME</B><BR>" >> $TMPFILE
echo "<BR>" >> $TMPFILE
echo " describe changes here('C' to change line)" >> $TMPFILE
## echo "</PRE>" >> $TMPFILE
type $TMPFILE $TMPFILE.1 >$TMPFILE.2
move /Y $TMPFILE.2 $TMPFILE
notepad.exe +/describe $TMPFILE
}

Public upload_journal()
{
scp -p ${JOURNALFILE} ${WINDOWSSSUSERNAME}@linux.starkstate.net:${WINDOWSSSDIRECTORY}/journal/
}

Public configdiff()
{
fc $1 $2 | sed "s/</\&lt;/g" | sed "s/>/\&gt;/g"
}

Public config()
{ ## this is a configuration file, get listing and dIfferences

If [ ! -e "$ARG4" ]
Then
cls;
echo "Configuration file needs a backup file!"
echo " use /dev/null if the config file was just created"
echo " always use cp -p when making backup file"
echo ""
$SCRIPT
exit 67
End If()
Dim MODTIME As Object =`dir $FILENAME | awk '{print $6, $7, $8}'`
echo "<BR><pre>" >> $TMPFILE
dir /N /A:D /T:W $FILENAME* $ARG4 | uniq >> $TMPFILE
echo "</pre>" >> $TMPFILE
echo "<TABLE border=1><tr><td align=center>" >> $TMPFILE
echo "Diff of <B>$FILENAME</B> and <B>$ARG4</B><BR></td></tr><tr><TD><PRE>" >> $TMPFILE
configfc $FILENAME $ARG4 >> $TMPFILE
echo "</PRE></TD></TR></TABLE>" >> $TMPFILE

journal_entry Configuration file $FILENAME
}

Public log()
{

If [ ! $ARG4 ]
Then
$SCRIPT
exit 68
End If()
dir /N /A:D $FILENAME >>$TMPFILE
Dim MODTIME As Object =`dir $FILENAME | awk '{print $6, $7, $8}'`
echo "<br /><br />### Listing of last <B>$ARG4</B> lines of logfile <B>$FILENAME</B> modified on <B>$MODTIME</B><BR><TABLE border=1><TR><TD><PRE>" >> $TMPFILE
tail -$ARG4 ${FILENAME} >> $TMPFILE
echo -e "</PRE></TD></TR></TABLE>\n\n" >> $TMPFILE
journal_entry LOG file $FILENAME
}
Public Function readin()
{ # read in from stdin into journal
READINFILE=/tmp/readin.$$
type > ${READINFILE}
echo "\n\n <TABLE width=95%><TR><TD><B>Output of command<B> on `date`<BR></TD></TR><TR><TD><PRE>\n" >> $TMPFILE
echo "${ARG3}\n<BR></PRE></TR></TD></TABLE><TABLE border=1><TR><TD><PRE>" >>$TMPFILE
type ${READINFILE} >>$TMPFILE
echo "</PRE></TD></TR></TABLE>" >>$TMPFILE

}

Public list()
{

echo "<BR>" >>$TMPFILE
dir /N /A:D $FILENAME >>$TMPFILE
Dim MODTIME As Object =`dir $FILENAME* | awk '{print $6, $7, $8}'`
echo "<TABLE width=95%><TR><TD>Listing of <B>$FILENAME</B> modified on <B><br />$MODTIME</B><BR></TD></TR></TABLE><TABLE border=1><TR><TD><PRE>" >> $TMPFILE
type ${FILENAME} >> $TMPFILE
echo "</PRE></TD></TR></TABLE>" >> $TMPFILE
journal_entry Listing of file $FILENAME
}

Public spell_check()
{
aspell -c $JOURNALFILE
}

End Function

End Module
 
I want to convert the Journal Bash Shell Script my professor told me I could continue using after graduation or whatever to Microsoft Visual Basic or whatever scripting language Windows uses for documentation purposes. The problem is that I'm not sure if the commands I choose are compatible or equivalent, so I don't know if the script will do what I think it might do because I haven't test it. Also I need to make a list of the commands or options in the script to help remember how to use it, but that's another problem. What's keeping me from doing this is that I don't have a working windows system with me at all times or often enough to test it on because I'm running Ubuntu Linux on my Laptop PC and my Mac Book Pro is having issues with both Mac OS X and Windows 7 being used through boot camp. Therefore, I can only use wine in Linux to test it, so I don't know if I'll get the desired results I'm looking for. Can anyone help me with testing or figuring this out, so I can take my professors brilliant script and use it to document on Windows because I have no problem using the script in Mac OS X except that I can't use aliases and I have to be root to run it. I will post the code I have for the original script in a reply next.

colon D is what the emoji is, which I didn't do intentionally and you can blame Hardforum for that.
 
Back
Top