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...
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...
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'...
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...
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...
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...
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.
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.
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...
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...
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}...
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...
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...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.