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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by charlieehler

  1. charlieehler

    REMSH across HP-UX Servers

    Hello EssJay, This is a bit complicated, but when working is a fine method of automating remote administration. First, you must establish trusted roles using /etc/hosts.equiv and/or /.rhosts files to enable the rsh processing. See the man pages for this. Next you will need to build a...
  2. charlieehler

    sed: replacement character is a single quote

    Hello Bi, Sambones gave you some really good info that will probably solve your problem, but didn't give you another good tip that might help. Whenever you think the shell might muck up your code and you really need that special character to go as text, then use a backslash to tell the shell...
  3. charlieehler

    prepending text to multiple files

    Hello Bi, I prefer to use ex in this instance where the text must go at the beginning of the file AND the file must be saved with the same name when completed. Suppose the insert text is a file named Insert.txt and must go into Test.log. A command file for ex must also be created and I'll...
  4. charlieehler

    Run ksh script from CGI

    Hello, The secret to cgi programming is that the output of your program or script must be in html format and thus create an html document. Compared to normal scripting, you will printf lots of html markup code which would otherwise be unnecessary to the operation of the script. I've...
  5. charlieehler

    define trap signals

    Cruel, So right. I normally use 16 or 17 to set up a child process that kills a read after a period of time. It works great for lists that need to refresh, but you might also want user input. I have never tried to define a kill signal(never had the need), but included them in case you...
  6. charlieehler

    define trap signals

    Hello Cruel, Your trap thinking should work, but do you only want to save on a ^S signal or most any signal that would abort the script? I suggest that you should consider the save as a normal interrupt action during the input process. It would look like this: trap1 () { # ^C trap...
  7. charlieehler

    sed syntax

    Hello, My mistake! The '/' and '/w ' prevent command garbled errors. Anyway the correct sed format(that works in solaris 2.5.1) is: sed -n '/'match string'/w 'output_file input_file Why this is correct is beyond me, since the man pages don't seem to indicate this. Later! Charlie Ehler
  8. charlieehler

    HowTo telnet with login/passwd

    Hello Rvarman, As far as I know you can telnet to the machine and even supply the userid, but the software will still ask for the password at the console. Various attempts to pass the password like in a script were all ignored. This seems to be a security feature in at least Sun Solaris...
  9. charlieehler

    Identifying the user

    Hello Daedelus, I thought you might want to know who the user really is so the "who am i" command will tell you the original logon name even after multiple su's. Later! Charlie Ehler
  10. charlieehler

    sed syntax

    Hello, It appears that this line is lifted from a Korn shell script although it could also be Bourne. In it the sed command is configured not to write to standard output(the -n). sed is getting its input from the file represented by the variable ${SRVLOG} and that sed is writing the line...
  11. charlieehler

    Find and Replace in multiple files

    Dan, So much for a single click. Sorry for the multiple responses. Charlie Ehler
  12. charlieehler

    Find and Replace in multiple files

    Hello Dan, Hope this one will help. I used a Bourne shell script and ex to solve the problem. Create Replace.sh in your home directory Insert: #!/bin/sh HomePath=`pwd` echo “Please enter the replacement directory path” read DirPath if [ -d $DirPath ] then echo “Please enter the...
  13. charlieehler

    Find and Replace in multiple files

    Hello Dan, Hope this one will help. I used a Bourne shell script and ex to solve the problem. Create Replace.sh in your home directory Insert: #!/bin/sh HomePath=/path/to/homedir echo “Please enter the replacement directory path” read DirPath if [ -d $DirPath ] then echo “Please...
  14. charlieehler

    Grepping a string across mutiple directories

    Hello Dan, This one is a bit sticky, so I don't usually recommend it from the root directory. It seems that grep(at least in Solaris 4.5.1) will get lost in an ELF file and some others I'm sure. Anyway, try: grep yourstring */*/*/* What happens is grep will search all files as...

Part and Inventory Search

Back
Top