Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. lordblood

    Solaris network printer does not print after cluster patch

    I'm having problems getting our network printer back up and running after applying the Solaris 10 x86 Recommended Patch Cluster. The Solaris box was printing just fine before the patch. The problem resolves around the use of Solaris' lp command. If I use the lpr command, everything prints just...
  2. lordblood

    Why doesn't this file lock code work?

    At a quick glance ... your only checking to see if the file exists ... if it does, your setting result to 1 indicating a lock (by having the file specified present). It has nothing to do with the contents of file. Lord Blood
  3. lordblood

    Sending Attachments with text and graphic via sendmail

    Can someone please tell me what I am doing wrong? I am trying to send an email with an attachment via shell script. The following is the finalized output. Basically it’s just a sentence and a gif attachment. The sentence appears fine when receiving the email but the attachment is always 0 bytes...
  4. lordblood

    MySql replication error

    I've setup my my.cnf file on the slave as: [mysql.server] user=mysql basedir=/var/lib socket=/var/lib/mysql/mysql.sock server-id=2 master-host=xxx.xxxxx.com master-user=replicate master-password=xxxxx Show slave status indicates "NO" under Slave_running, and I get mysql> slave start...
  5. lordblood

    class function declarations

    I'm a C programmer attempting to learn more about C++ programming. I've been looking at C++ header files to familiarize myself with class declarations. I understand a fair amount about how the class structure works but I'm trying to figure out this: (from exception.h on a SUN Solaris workshop...
  6. lordblood

    another question in my code, if statement syntax error

    You can try something like this( I didnt know if you wanted the names on the same entry or different entries... this is different entry for each first / last name combination): #!/usr/bin/csh # # Solaris Unix echo -n &quot;FIRSTNAME: &quot; set first = ( `echo $<` ) echo -n &quot;LAST NAME...
  7. lordblood

    another question in my code, if statement syntax error

    Try this: echo -n &quot;FirstName: &quot; set first = $< echo -n &quot;LastName: &quot; set last = $< if (`fgrep -c $last .phonebook`) then echo -n &quot;**ERROR**&quot; else printf &quot;%s:%s:::\n&quot; $first $last >> .phonebook endif I believe your error comes from the fact...
  8. lordblood

    compile error with strtof

    Try using the functions: strtod() atof() They produce double results but you can cast to floats if you need that. Just something to think about ;-)
  9. lordblood

    command line pattern and $ vars

    Try this: #!/usr/bin/ksh for item in *.new do mv $item ${item%.new}.old done Just something to think about ;-)
  10. lordblood

    Linux Certifications..

    ;-) Just to add my 2 cents... If you attempt the SAIR certification (which my company wants me to complete) and your looking for books to study, I would suggest not buying their books. I'd use a third party book because the SAIR books are full of typos and mistakes. I have read 3 SAIR books...
  11. lordblood

    Getting file listing of directory and subdirectories

    Just something to think about ;-). Not fully tested! You can try something like this ... (using C on Linux): Output is like: DIR: X FILE: afile.c FILE: bfile.c . . . #include <stdio.h> #include <sys/types.h> #include <dirent.h> #include <sys/stat.h> #include <unistd.h> void...
  12. lordblood

    Loading an int with bits

    You can just set the bit with something like (Solaris): var |= (1 << bit_to_set); ---------------------- ... var |= (1 << 0); /*First bit ... shift 0 bits*/ var |= (1 << 1); /*Second bit ... shift 1 bit*/ printf(&quot;%d\n&quot;, var); /* Prints 3 (8-bits example) 00000011*/ Just...
  13. lordblood

    How to hex2ascii???

    If your trying to take a character string &quot;69&quot; (in hex) and make a decimal representation (105 in decimal). This is just something to think about. I have not fully tested it ... just whipped something up. I'm sure someone can do better ;-) Try this(take a string and figure out the...
  14. lordblood

    Dynamic memory allocation for 2D arrays

    Just something to think about ... ;-) Try this: #include <stdio.h> #include <stdlib.h> void print2d(int **,int,int); int ** resize(int **,int,int); void free2d(int **,int); int main() { int i = 0, j = 0; int **array, row = 5, col = 5, prow = row + 4, pcol = col + 1; /*...
  15. lordblood

    Variable call not working

    Loose the spaces when assigning var. change: var = `groups $USER_ID` to: var=`groups $USER_ID` Hope this helps ;-)
  16. lordblood

    structure =&gt; function =&gt; main =&gt; another function

    Heres a small example of what you can do... Just something to think about ;-) #include <stdio.h> #include <string.h> typedef struct tagData { int month, day, year; char message[32]; }data_t; void first_function(data_t *d); void second_function(data_t *d); main() { data_t mydata...
  17. lordblood

    Reg expression not working

    On my linux box I can do: $line =~ s/\t/ /eg; # substitute tab with a space $line = &quot;\\a&quot;.${line}; # add \a to the beginning Hope this gives you something to think about. ;-)
  18. lordblood

    current date - 3 days ago

    Try this (on Solaris): #include <stdio.h> #include <time.h> main() { time_t ts; struct tm *gmt; /*Time Now*/ time(&ts); gmt = gmtime(&ts); /*Loose 3 days*/ gmt->tm_mday -= 3; /*Make new time*/ ts = mktime(gmt); gmt = gmtime(&ts)...
  19. lordblood

    tar help...

    This is how it works on my Solaris machine: tar -cvfX some.tar loose *.c where 'loose' is a file containing excluded files so: List directory $ls a.c b.c union.c x_string.c Cat loose file %cat loose union.c Tar the c files %tar -cvfX some.tar loose *.c a a.c 1K a b.c 1K a union.c excluded a...
  20. lordblood

    if test -e command doesn't work!

    Try this: #!/usr/bin/sh LIST=`ls -1 file*.dat` for file_name in $LIST do if [ -f $file_name -a -s $file_name ]; then echo &quot;MATCH&quot; else echo &quot;NONMATCH&quot; fi done Hope this gives you something to think about. The best teacher is yourself; therefore, I...

Part and Inventory Search

Back
Top