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 gkittelson 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. fusi0n

    Selectively splitting a file with C-shell?

    Unfortunately, I need to run this script under csh (or I have to convert a lot of other code too), BUT this does give me some good ideas about where to go from here. Thanks so much!
  2. fusi0n

    Selectively splitting a file with C-shell?

    I tried previously, but couldn't figure out a better solution using awk as the line numbers between each @<TRIPOS>molecule separator vary, as do the number of entries in the file. I'll go back and try again though.
  3. fusi0n

    Selectively splitting a file with C-shell?

    I have a rather long csh script that works, but it's terribly ungraceful and takes a while from various loops. I only know enough code to get myself into trouble, so I'm looking for some guidance. I have a large file that is separated at regular intervals by the same line, like this...
  4. fusi0n

    Passing more than one variable from the shell to AWK?

    Fantastic! That worked like a charm. Thank you very much for the fix! And thank you for explaining what the problem was.
  5. fusi0n

    Passing more than one variable from the shell to AWK?

    My apologies for the incorrect thread title. I'm still very new to this and thought I was having problems passing more than one 'shell' variable into my awk string. What would a more appropriate summary of the problem be? Any ideas on how to fix it? Thanks!
  6. fusi0n

    Passing more than one variable from the shell to AWK?

    Hi! I'm having some problems getting AWK to use more than one variable from the shell. In a long bit of code I have the snippet: suf=00"$i" molwsuf="$molname"_"$suf"_hbond h=`cat $molwsuf` gawk '/'"$molname"_"$suf"'/ {print '"$i"', $2, $4, $6, '"$h"'}' $logfile >> $filename Where i is an...
  7. fusi0n

    Setting an environment variable from awk output within a shell script?

    Well, that would sure explain why I couldn't get anything to work prior! :) That fixes the biggest problem I was having (which are usually the silliest ones). Thanks so much!!
  8. fusi0n

    Setting an environment variable from awk output within a shell script?

    I hadn't tried the eval version. Both of them, when run from the command line, will set the variable correctly. However, when I put either one in a shell script and run it, it still doesn't set the variable, claiming it to be undefined when I try to echo it afterwards.
  9. fusi0n

    Setting an environment variable from awk output within a shell script?

    Hi! I'm reasonably new to awk and shell scripting, and am having difficulties with getting my shell script to set an environment variable based on the awk output from within a shell. I need to be able to reset the variable for each pass of a loop. Basically, I fetch the name from a file using...

Part and Inventory Search

Back
Top