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 wOOdy-Soft 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: *

  • Users: micotao
  • Content: Threads
  • Order by date
  1. micotao

    How to set the "From:" field value on demand in Sendmail?

    Hi, All: When we use mailx command to send email to some specific email address, can we configure the "From:" field value? I mean, by default, the recipients will see the From: as root@<host>.<domain>, but can this be configured on our demand? Say, we don't want it to be displayed as...
  2. micotao

    Can &quot;From:&quot; field be configured on demand in Sendmail?

    Hi, All: When we use mailx command to send email to some specific email address, can we configure the "From:" field value? I mean, by default, the recipients will see the From: as root@<host>.<domain>, but can this be configured on our demand? Say, we don't want it to be displayed as...
  3. micotao

    How to decode such characters for a string or file content

    Hi, All: Suppose this is the file content I have, and I need to do some "translation" to specific characters.File content or some string like this: This is a decoding process. We have to do this.\\1aWe need \\7b CHANGE \\7d. The characters that need decoding are: '\\1a' ----> '\n' '\\7b'...
  4. micotao

    How to use Array and Arithmetic for in KSH?

    Hi,all: Please look at the following ksh script. #!/bin/ksh set -A name 1 2 3 4 5 NUM_MAX=5 for ((i = 0; i <= NUM_MAX-1; i++)) do echo ${A[$i]} done I can't see obvious errors, but in fact, I got the following syntax error reporting: ./test[4]: syntax error at line 4 : `((' unexpected...
  5. micotao

    How to extract some lines from one file to output to another file

    Hi, If I want to extract the contents of one file, from its line 3 to its line 15( suppose it has 100 lines). Which commands can I use to function this? I only know how to extract the first N lines from one file to output to another file, say: head -16 somefile > otherfile Thanks for your...
  6. micotao

    To truncate one input file content to a fixed length?

    Hi, All: Here I'd like to read in a plain text file,, but I need to keep its original format( its orginal format is line after line, we will keep this), and to keep the read-in characters to be no more than 160 characters, and write these read-in content(keep its original format,even if we...
  7. micotao

    Capability of unix mailx sending email

    Hi, All: Please help to investigate how long the maximum email content body length can support? I mean, do we have any limitations on the max message body length when we use mailx command to send email. Does anyone have experience on this or test results on this? Thanks.
  8. micotao

    Can we invoke a script in a C++ program/method?

    Hi, All: Here I have a question, suppose we have a C++ based module, can we design a class method for the C++ program in which we invoke another external shell script to finish some function? It is feasible? Any hints or suggestions are highly welcomed.
  9. micotao

    How to set Mail Subject and Mail content by mail command in shell?

    Hi, All: I'd like to write a script which can send email to some specific receivers. I want to use mail command in my shell script to realize this, but I don't know how to set the Mail Subject,(say, "Test Email") when calling mail command in shell script. I don't want to input by interactive...
  10. micotao

    Replace only one pattern of a line in a file using Awk or Sed?

    Hi, I want to only replace one pattern in specified line of one file.The file may contains many lines,the line containing the pattern 'http:' is: ServerResourceURL DN=http://nwp001:8080/data/filesrc.cgi I want to replace nwp001--->pwd003, only in the line containing the 'http:' pattern, and...
  11. micotao

    awk-printf-substr ----printf's usage + awk-in clause

    Hi, All: Please check this script, to see what's the problem, I think it is right, but the running result makes me sad!! (1)the source code #!/bin/ksh LDIF_LIST="/tmp/myfile" for item in ${LDIF_LIST} do if [ -f ${item} ]; then crtfile=`basename ${item}` cp ${item}...
  12. micotao

    How to do value-substitution in sed/awk??

    Hi, All: Although we can do pattern match and corresponding substitution in Awk and Sed, I find it very disable when we want to do value-substitution.I mean:say, when I want to replace the words which equal to the value of $var1(say,$var1="charlie", we want to replace where it is charlie to...
  13. micotao

    How to match a variable's value in AWK?

    Hi all: say,there is such a awk statment in a "test.sh" file: hostname_1=`hostname` IP=`cat /etc/hosts | awk '{ if ($2==hostname_1) print $1}'` echo $IP the IP of hostname_1 in /etc/hosts is 165.167.189.21 but WHY IT OUTPUTS a blank line????? WHY IP cannot get the corresponding value in...
  14. micotao

    awk-printf-substr

    Dear all: I find it strange when I try this under the Solaris9-bash shell. why $-prompt) awk '{ if (substr($0,1,1)==" ") printf "%s" substr($0,2,100) }' file_my run output is this: awk: not enough arguments in printf(%sXXXXABCD0000 abc) or sprintf(%sXXXXABC D0000 abc) record number 1 The...

Part and Inventory Search

Back
Top