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 IamaSherpa 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. rigstars1

    uninitialized value message?

    Thanks for all the input. Adding this line of code by tsuji really helped and solved the problem! return undef unless defined $text; I'm no longer getting this warning message - "Use of uninitialized value in transliteration (tr///)
  2. rigstars1

    uninitialized value message?

    I've should've of provided more code. I already initialized the variable. Like so .. sub check_address { my $text = shift; # There should only be 1 colon my $count = $text =~ tr/://; return undef if $count != 1; # There should only be three .s $count = $text =~ tr/.//; return...
  3. rigstars1

    uninitialized value message?

    Hello everyone, I keep getting this message every so often when my perl script runs. Any one have any ideas how to fix it? The message points to this particular code in my script. Use of uninitialized value in transliteration (tr///) my $count = $text =~ tr/://; Thanks!
  4. rigstars1

    help returning active interface?

    PVH, The add-in of the case statement made it work. Thanks for that!!! Dkyrtata, Appreciate your help and for not giving up on the assistance!!
  5. rigstars1

    help returning active interface?

    CORRECTION: I can't get it to NOT print the "found=N" statement.
  6. rigstars1

    help returning active interface?

    when I ran this script with the following changes .. I get this output en1 found=Y I can't get it to NOT print the "found=Y" statement. I tried to put a 'break' after the found="Y" but it still echos the found="N" ---------------------------------------- found="N" for iface in `ifconfig -lu`...
  7. rigstars1

    help returning active interface?

    sorry dkyrtata ..here's your original script .. I think there is confusion .. the output of the script is right if there are no active interfaces found. The issue here is when it does find an active interfaces, it executes both statements ..printing like so .. no matter what I do to modify it...
  8. rigstars1

    help returning active interface?

    # here is the script that dkyrtata provided to me found="N" for iface in `ifconfig -lu` ; do if [[ "$iface" != lo* ]]; then ifconfig $iface | grep -q 'inet ' && echo $iface found="Y" done fi if [ "$found"=="N" ] ; then echo "???" fi # below is my changes to try...
  9. rigstars1

    help returning active interface?

    whether 'found' is upper or lower case ..the script executes the same ..i made lower case and it still produces the same result ..both statements are written when an active interface is found .. like so ..which is not the desired results en1 No active interfaces found
  10. rigstars1

    help returning active interface?

    I already tried that. still produces the same result. I tried putting an 'exit' block after it finds the interface so that it doesn't go to the next line of code "No active interfaces found" but it if I do that, this never gets checked if [ "$found" = "N" ]; then echo "No active interfaces...
  11. rigstars1

    help returning active interface?

    dkyrtata, Thanks for the quick reply. The bash one almost works as expected ..when it finds the active interface ..it prints both en1 and No active interfaces found ..like this en1 No active interfaces found Can you please correct that?
  12. rigstars1

    help returning active interface?

    The script searches for active interfaces and returns the correct value except I want to also add a statement in there that returns "No active interfaces found" if there are truly no active interfaces.. having trouble adding an if/else statement in here? Any suggestions? #!/bin/sh for iface in...
  13. rigstars1

    help returning active interface?

    The script searches for active interfaces and returns the correct value except I want to also add a statement in there that returns "No active interfaces found" if there are truly no active interfaces.. having trouble adding an if/else statement in here? Any suggestions? #!/bin/sh for iface in...
  14. rigstars1

    grep command error UID: command not found

    PHV - I'm not sure what the '^' does but it didn't work. I just misplaced my backticks. Now it works. Nice try though. Appreciate the effort. `ps -l -u squid | grep unlinkd | cut -c 96-102`
  15. rigstars1

    grep command error UID: command not found

    This command greps for 'unlinkd' which works fine ps -l -u squid | grep unlinkd | cut -c 96-102 but as soon as I put it in a script ..the output is always the word 'UID' Any one know why that is? variable=(`ps -l -u squid` "| grep unlinkd | cut -c 96-102")
  16. rigstars1

    awk cmd-get total size of directory including subdirectories

    du -ch | grep total | cut -f1 this does the trick for me ..
  17. rigstars1

    awk cmd-get total size of directory including subdirectories

    because I'm trying to use call this as a script in my customize prompt ..so when i go to any directory it will give me the total size of the directory I'm in automatically ..
  18. rigstars1

    awk cmd-get total size of directory including subdirectories

    ls –lR |awk '{total +=$5};END {print "Total size: " total/1024/1024 " Mb"}' I'm trying to get the total size of the current directory including subdirectories with this command. Can't figure out why it gives me this message. Can someone provide some guidance? Thanks! ls: –lR: No such file or...
  19. rigstars1

    awk alias is not working

    I need help setting this up as an alias in bash. I can't get it working. Please help. top -l 1 | awk '/PhysMem/ {print "Used: " $8 " Free: " $10}'?

Part and Inventory Search

Back
Top