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

    How to stop MS Word 2003 auto-changing hyperlink on save

    Thanks ad39311 I'd done a bit more research since, too, and found the same answer you gave - I'm including it here so people are linked to a possible other source of answers: The answer is here...
  2. kornShellScripter

    How to stop MS Word 2003 auto-changing hyperlink on save

    I've had no replies to this, Did I post it in the wrong forum, or was it a silly question?
  3. kornShellScripter

    How to stop MS Word 2003 auto-changing hyperlink on save

    In MS Word 2003, I'm writing a document that involves linking to two Excel spreadsheets. \\bp1ldcvi012\darren$\WORK\Migration\Apps.xls \\bp1ldcvi012\MISC2\Apps Support Team\Middle Office\_General\Supported Apps.xls These links work as I create them (I can ctrl-click them and the spreadsheets...
  4. kornShellScripter

    How2 find files, in current dir, beginning with letters c or f

    Hi PHV, What I meant was: $ FOO=$(find * -prune -type -f -name file_does_not_exist) $ echo $FOO|od -c 0000000 \n 0000001 $ That new-line is proving to be a pain.
  5. kornShellScripter

    How2 find files, in current dir, beginning with letters c or f

    There is a problem with this method: if there are no files found, FILE_LIST="\n", which is a pain. Sure, I can test for this and remove it later, but it would be neater if there is a way to cause FILE_LIST="" if find finds no files?
  6. kornShellScripter

    How2 find files, in current dir, beginning with letters c or f

    I am writing a script that: - does an rsh to various unix boxes, and on each one... - list the files in a given directory that begin with certain letters I currently do it the following way, which seems like a cludge and I was hoping if any of you had a better suggestion? I use "find * -prune...
  7. kornShellScripter

    tricky about grep command

    Hi hokky, man odhas a pretty neat table that I've been referring to since I started this role at the end of March just to keep a ready-reckoner of "Unix=lf, Dos=cr/lf, cr=\015=^M" - I didn't have to look those up as I wrote that so I guess it's stuck now :) In my analysis of what the various...
  8. kornShellScripter

    removing leading/trailing white space

    Hi again p5wizard Sorry, was answering a different train of thought :) Completely understand the use of functions. Thanks for your suggestion. (as an aside - this legacy code I'm working on in parallel is heavily functioned, and uses lines like the "if [[ $AR = 1 ]]" which leaves me asking...
  9. kornShellScripter

    removing leading/trailing white space

    Hi p5wizard, There's various schools of thought I've encountered at my various client sites about the use of comments, and the school of thought they have here is that comments are not there to teach the reader unix commands, they're there to explain the business reasons behind code logic. So...
  10. kornShellScripter

    tricky about grep command

    Hi hokky, I'm developing a script that analyses non-unix files (that end up on a unix file system) so I've encountered exactly the same problem. Commands like sed, awk and grep expect a file in unix format, so they expect their lines to end with a line feed. I'm constantly looking into the...
  11. kornShellScripter

    removing leading/trailing white space

    Oops! Sorry, my careless copying. I should have put two spaces in between ## and * This works: $ cat file 020 PPP GB 123 ABC G XXX $ VALUE=$(cut -c10-25 file) ; VALUE=${VALUE%% *} ; echo "$VALUE" | od -ta 0000000 G B sp 1 2 3 sp A B C sp G lf 0000015 $ Also, for...
  12. kornShellScripter

    removing leading/trailing white space

    I'd do it all in perl if I had my way :) It's a requirement to do the bulk of the script in ksh, and to make it highly readable for the non-unix BAs and the non-unix production support staff. Also, my awk/nawk is non-existant. Is it possible to combine the cut + sed to strip leading&trailing...
  13. kornShellScripter

    removing leading/trailing white space

    Hi, I'm using ksh and am analysing reports which have fixed column widths (candidate for the cut command). The values in that particular column might not be as wide as the column, so VALUE=$(cut -c10-25 file) might set VALUE="GB 123 ABC G " and what I want is VALUE="GB 123 ABC G" (so I want...
  14. kornShellScripter

    korn shell's [[/]] and wildcard expansion

    yeah that worked. Thanks :) > i=0;time while [[ $i -lt 100000 ]]; do ((i+=1));done real 0m1.44s user 0m1.44s sys 0m0.00s > i=0;time while [ $i -lt 100000 ]; do ((i+=1));done real 0m1.95s user 0m1.95s sys 0m0.00s
  15. kornShellScripter

    korn shell's [[/]] and wildcard expansion

    Hi, the ((i++)) doesn't appear to work on my ksh: master # i=0; time while [[ $i -lt 100000 ]]; do ((i++)); done ksh: i++: more tokens expected master # ps -fp$$ UID PID PPID C STIME TTY TIME CMD master 12211 12210 0 11:24:27 pts/18 0:00 -ksh
  16. kornShellScripter

    korn shell's [[/]] and wildcard expansion

    # type [[ [[ is a reserved shell keyword # type [ [ is a shell builtin # type test test is a shell builtin So if it's all internal, what, really, is the difference between a "reserved shell keyword" and a "shell builtin" and does it really matter for efficiency purposes?
  17. kornShellScripter

    korn shell's [[/]] and wildcard expansion

    I'm testing for the existence of files that begin with, say, "gene" and have 8 characters in the filename. So gene???? This will not work: if [[ -f gene???? ]] because [[/]] does not allow wildcard expansion. So I'm currently using if [ -f gene???? ] But it would be nice to keep this test...
  18. kornShellScripter

    passing changing strings into nawk? (quoting issue)

    In line with Ferherke's tip to try to get nawk to do as much work as possible, I replaced: OUT_TEXT_DATE=$(grep 'AP BALANCES AS AT' $FILE_NAME | nawk '{print $6} | head -1' with OUT_TEXT_DATE=$(nawk '/AP BALANCES AS AT/{print $6}' $FILE_NAME | head -1) (I'm not a nawk person so I'm learning...
  19. kornShellScripter

    Trailing (only) cr/lf Removal

    Although not an exact answer for your specific problem, I'm having to handle similar issues with the files input to me. So thought I'd just mention the things I am dealing with at the moment in case it gives you any further ideas: I'm writing a Unix korn shell script to analyse text files. So...
  20. kornShellScripter

    nawk - how to remove comma from "26 Apr, 2007"?

    Another solution, which I think is closer to what I want: nawk 'sub(",",""){print $6, $7, $8}' Got this function from the O'Reilly "sed & awk" book by Dale Dougherty

Part and Inventory Search

Back
Top