Hi, xmb:
Thanks for your help.
There is a related question about \ backslash escape impact in a string:
How can I understand these two output, the different \ numbers,but the same result:
under KSH
# printf "%s" "This is\nThat is"
This is\nThat is
# printf "%s" "This is\\nThat...
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, xmb:
Can you help with the usage about gsub( which has the same behaviour as sub) and the split?
Because I don't know how many times and how the backslash '\' will be processed?
I really feel confused by the \ backslash in the string or some file content.
Thanks very much in...
Hi, xmb:
Thank you very much. I will take time to investigate your code and raise comments soon.
Hi, PHV:
Thank you a lot. I use nawk, and it works. Thanks xmb for reminder too.
Hi, PHV:
This is what I done to test the code from you. I wrote a ksh script which comes from your code directly.But I got the following output error:
+ awk { split("\\\\\\\\1a,\\\\\\\\7b,\\\\\\\\7d",from,",");split("\\n,{,}",to,","); N=3 }{ for (i=1;i<=N;++i)...
Hi, PHV:
Thanks for your valuable instruction.
I am still trying to understand your code.
But during my testing for trial of the following code:
# echo "This is\\\\\\\\1aThat is" | tr '\\1a' "\n"
This is
1aThat is
Can you tell me why that is the output result? As I want to...
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, maltais:
Thanks for your comments. But the usage you described is aimed to pass the first 160 characters of each line, instead of the first 160 characters of the file1, so it is not what we want. Do you have any further comments?
Thanks.
Hi, PHV:
Thanks for your help. "dd" can perform the work. And I think there is another same kind question here. If we want to truncate a string to a fixed length. Say, there is a 500 characters long string1, we want to keep the first 160 characters and assigned it to another string2 if we...
Hi, PHV:
Thanks for your reply. Yes, My mistake, I should use printf. But now, I even got the wrong result, it insert a blank line between the original lines,which is not what I want. I want to read in the content of the original file, keep its format unchanged, and just read in 160...
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.