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 TouchToneTommy 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. entrylevel

    want to use awk for this

    ooh, gsub might be the solution, but is there a smart way to deal with 3 files something like use NR==FNR to process lines from 2 files. Thanks. Regards!
  2. entrylevel

    newbie question, exec shell command in perl

    ooh, I see your point, there is an option that I omitted, should be smbpasswd -U uid, thanks.
  3. entrylevel

    newbie question, exec shell command in perl

    everybody can execute the smbpasswd if I understood you correct. the cgi script can be run successfully, just after adding this part (which can be used in the shell), nothing happened to samba password, the script just skipped this part, so i m thinking maybe there is different way to write it...
  4. entrylevel

    newbie question, exec shell command in perl

    plus, when I call this function in a perl cgi script, it seems "print" and EOF do not work from there. how can I accomplish the same function in a cgi script not run directly from shell. Thanks.
  5. entrylevel

    newbie question, exec shell command in perl

    :) just realized I could do it that way. Thanks. above code, if I declear $oldpasswd, $newpasswd, $verifypasswd outside of function changesmbpasswd, how can I pass the value into this function? still newbie, I know.
  6. entrylevel

    newbie question, exec shell command in perl

    in shell i can use redirect to /dev/null and there is no output, but in perl #!/usr/bin/perl -w use strict; sub changesmbpasswd { my $oldpasswd = "oldpass"; my $newpasswd = "newpass"; my $verifypasswd = "newpass"; open (PROG, "|/usr/local/samba/bin/smbpasswd -s") or die ("can't open...
  7. entrylevel

    newbie question, exec shell command in perl

    Thanks for the post. one more question, how can I get rid of the output in perl? thanks.
  8. entrylevel

    newbie question, exec shell command in perl

    in shell I can do /usr/local/samba/bin/smbpasswd -s << EOF > /dev/null $oldpasswd $newpasswd $verifypasswd EOF how to translate it to perl? simply add system seems does not work ... system ("/usr/local/samba/bin/smbpasswd -s << EOF > /dev/null $oldpasswd $newpasswd $verifypasswd EOF ")...
  9. entrylevel

    find difference between two files (added, removed, changed)

    thanks everybody PHV, futurelet and xmb, I learned a lot! Regards! FNR==NR {f1[$1]=$2;next} {f2[$1]=$2} END{ m=0 n=0 p=0 for(i in f1) if(!(i in f2)) m++ if(m>=1) print "following lines have been removed" for(i in f1) if(!(i in f2)) print i, f1[i] for(i in f2) if(!(i in f1)) n++ if(n>=1) print...
  10. entrylevel

    find difference between two files (added, removed, changed)

    thanks for the details, I will put some time on above xmb's posts and study. regarding the 2nd post from me, file1 to array fb[file1,FNR]=$1 fn[file1,$1]=$2 f1[$1]=$2 file2 to array fb[file2,FNR]=$1 fn[file1,$1]=$2 f2[$1]=$2 it seems I cannot do in either way below 1. NR==FNR {f1[$1] =...
  11. entrylevel

    find difference between two files (added, removed, changed)

    Hi xmb, sorry, nawk works. thanks. Regards!
  12. entrylevel

    find difference between two files (added, removed, changed)

    Hi xmb, Thanks for the post, I need some time to digest your code above, however, when I cut/paste the code and ran it ... # awk -f awkf1 -v file=file1 file2 awk: syntax error near line 30 awk: illegal statement near line 30 awk: syntax error near line 32 awk: illegal statement near line 32...
  13. entrylevel

    find difference between two files (added, removed, changed)

    I want to load these two files to arrays then compare them, file1 to array fb[file1,FNR]=$1 fn[file1,$1]=$2 f1[$1]=$2 file2 to array fb[file2,FNR]=$1 fn[file1,$1]=$2 f2[$1]=$2 please let me know whether the flow below is possible to load everything or not. Thanks. BEGIN {FS = OFS = "\t"}...
  14. entrylevel

    find difference between two files (added, removed, changed)

    I read some of the posts here, but still could not come up a very good and smart logic for my case using awk goal is to find difference between two files (the added lines, the removed lines and the changed lines) (first column are unique entries while 2nd column may contain duplicate entries)...
  15. entrylevel

    solaris 8 telnet problem

    Hi KenCunningham, Thanks for reply, I was NOT trying to login as root, and below are what I ve checked so far, # netstat -an | grep '*.23' | grep LISTEN *.23 *.* 0 0 24576 0 LISTEN *.23 *.*...
  16. entrylevel

    solaris 8 telnet problem

    Hi I got a problem on solaris 8 when using the telnet, host1% telnet host2 Trying 138.123.128.144... Connected to host2.cocome.com. Escape character is '^]'. SunOS 5.8 Connection to host2.cocome.com closed by foreign host. It immediately disconnected, checked all realated files that I...
  17. entrylevel

    how to deal with [] with foreach in csh

    Hi PH, Tried what you suggested still got foreach: No match I think I should jump out of the mind with foreach, since I can do > set testvar="`cat list | head -1`" do you have a good idea on how to read from a file (each line) and assign it to a variable, that way will do it. I know csh...
  18. entrylevel

    how to deal with [] with foreach in csh

    I have a file contains all the names that i need to create directories for, > more list align_c_i_fix_out_reg[9]:D.sp add_408_40_g121:A.sp align_c_i_fix_out_reg[10]:D.sp align_g1851:A0.sp in sh i can do with no problem #!/bin/sh for var in `cat list` do mkdir tmp/"$var" done in ksh i...
  19. entrylevel

    how to append $var zeros to a string

    thanks guys for pointing out. Regards!

Part and Inventory Search

Back
Top