home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.editors      What? Edlin ain't good enough for you?      123,932 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 123,586 of 123,932   
   Lawrence D'Oliveiro to All   
   Re: How to edit HTML source file on Wind   
   18 Jan 25 20:54:19   
   
   XPost: alt.comp.os.windows-10, alt.comp.software.firefox   
   From: ldo@nz.invalid   
      
   On Sat, 18 Jan 2025 13:55:07 -0500, Newyana2 wrote:   
      
   > Shell scripts? Maybe a little Perl? That's not programming code.   
      
   db_user=   
   db_passwd=   
   db_host=   
   for ((;;)); do   
       if [ "${1:0:2}" != "--" ]; then   
           break   
       fi   
       opt="${1:2:${#1}}"   
       shift   
       val="${opt#*=}"   
       opt="${opt%%=*}"   
       if [ "$opt" = "user" ]; then   
           db_user="$val"   
       elif [ "$opt" = "password" ]; then   
           db_passwd="$val"   
       elif [ "$opt" = "host" ]; then   
           db_host="$val"   
       else   
           echo "bad option $opt" 1>&2   
           exit 3   
       fi   
   done   
   if [ $# != 1 ]; then   
       echo $'Usage:\n\t'"$0"$' [--user=user] [--password=passwd] \n' 1>&2   
       exit 3   
   fi   
   dbname="$1"   
      
   basecmd="mysql"   
   if [ "$db_user" != "" ]; then   
       basecmd="$basecmd -u $db_user"   
   fi   
   if [ "$db_passwd" != "" ]; then   
       basecmd="$basecmd -p$db_passwd"   
   fi   
   if [ "$db_host" != "" ]; then   
       basecmd="$basecmd -h $db_host"   
   fi   
   echo "Tables for $dbname:"   
   for table in $($basecmd -B -e "show tables from $dbname" | tail -n+2); do   
       echo   
       echo "Fields for $table:"   
       $basecmd $dbname -e "show columns from $table"   
   done   
      
   --- SoupGate-DOS v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca