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. codemut

    cgi permissions

    Also, this CGI is in a Linux / Apache system.
  2. codemut

    cgi permissions

    Without correct permissions for files created by CGI scripts, a script will fail. So, how to set permissions automatically (on the fly) when generating CGI files with new or unique names? By the way, the cgi code is compiled/binary, so no mod_perl, etc.
  3. codemut

    string to literal conversion

    Thanks so far ... but plucking out the '+' is key. If only there was something like strtonum(arr[2]) to force '+' to function.
  4. codemut

    string to literal conversion

    Based on this code... BEGIN { str = "2+2" split(str,arr,"") print arr[1] arr[2] arr[3] } ...how can one simply convert the string arr[2] to the + math operator so as to print 4?
  5. codemut

    gawk smtp

    Annihilannic, The systems are freeBSD w/sendmail and openSuse w/postfix. However, given the new service of connection = "/inet/tcp/0/"smtp"/25", is the local mta relevant? A successful local test makes it all the more puzzling since the same parameters work via command line/telnet to the...
  6. codemut

    gawk smtp

    A print statement was added to view server info. The "print "HELO ..." statement yields the server's 1st msg: "220 mail.server.com ESMTP" ... then the script hangs w/out any further output (even with the above code suggestions). Maybe fflush() or close() is in order... but how to do w/out...
  7. codemut

    gawk smtp

    Here's a quiz... How to use smtp with gawk. What works on the bash command line is not working in an awk script. Consider the following code: BEGIN { RS = ORS = "\r\n" to = "name@server.com" from = "name2@server.com" text = "testing1...testing2...testing3..." subject = "testing...
  8. codemut

    script path

    PHV, your suggestion is closest to my ideal. Given that parentheses around a command starts a subshell, maybe one ought to include ";exit" near the end. Edcrosbys, after the first line in the script it is just a typical gawk script with: BEGIN { ... Mike042 and Annihilannic, you raise...
  9. codemut

    script path

    The first line is #!/usr/bin/gawk -f, which works fine executing within the current directory. Hope to execute files that are in either a subdirectory or outside the current directory (which may require the full path from / ).
  10. codemut

    script path

    Thanks Annihilannic, With: /another/directory/script, returned is: bash: /another/directory/script: No such file or directory With: ./another/directory/script, the terminal hangs. While the following seems to work: cmd="cd another/directory; ./script; cd .." eval $cmd unset cmd ... it seems...
  11. codemut

    script path

    How should a script in another directory be run, such as /another/directory/script ? My shell is bash.
  12. codemut

    process monitor

    Previously, the individual scripts called the meter script directly, an incremented counter sent as an argument for generating the percent of total complete. As that became cumbersome, a single call to the meter became the goal. If/when accomplished, marking intervals using strftime() between...
  13. codemut

    Multiline concatination

    Try: awk '{ORS=""; if(++n>1) print}'
  14. codemut

    process monitor

    The main script: #!/usr/bin/gawk -f BEGIN { cmd1 = "./meterScript" ### output to terminal print cmd1 | "bash" close(cmd1) ### script3 below must wait for script2 cmd2 = "./script2; wait" ### output to a file print cmd2 | "bash" close(cmd2) cmd3 = "./script3" ###...
  15. codemut

    process monitor

    I've got a gawk script that controls other gawk scripts, one of which displays overall progress on the command line. While a progress display is simple to implement given iterations within a given script, I wish to monitor the progress of the controlling script via process id and to add an...
  16. codemut

    executable script

    PHV, Your solutions are right on! So, can you recommend a favorite awk book? I have Effective Awk by Robbins. It would be nice to find more for accommodating user defined function libraries... maybe for a coming version of gawk?
  17. codemut

    executable script

    Challenge: to convert what works on the command line into an executable script, putting each string within a file into an array, the file delimeter being empty space of any length. This works on the command line: gawk '/searchstring/ {split($0, arr, " "); for (i = 1; i <= NF; i++) { if...
  18. codemut

    common pipe for multiple programs

    Thanks Annihilannic; the program now works as desired. To answer PHV, there is an error without the tee; the cause is undiscovered.
  19. codemut

    common pipe for multiple programs

    How might the following bash code be modified to suppress tee's output to terminal? ./prog1 | tee >(./prog2 > file1) >(./prog3 > file2)
  20. codemut

    long shell commands

    Perhaps awk is not the best language for a long bash/sql interaction like that in quotes here: command = "sqlite3 filename.sql <<SQL_ENTRY ... several lines of SQL ... SQL_ENTRY" Any ideas on how to make a command of many lines appear as one string (or how to better...

Part and Inventory Search

Back
Top