07-25-2005
Quote:
Originally Posted by vibhor_agarwali
echo 12345 | sed 's/^.\{3\}\(.\).*/\1/'
echo 12345 | sed 's/^.\{3\}\(.\).*/\1/'
4
Quote:
Originally Posted by vibhor_agarwali
Then won't this work.
echo 12345 | sed 's/^\(...\)\(.\).*/\1\2/'
1234
I don't know - depends on the the definition of 'works'
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need a better way to read the first character of each line in a file and check if it equals the special character ¤. This character tells me where there is a break in the reports. The file has over 500,000 lines. Currently, this is my code -
if ]
I am using Korn Shell as a scripting... (7 Replies)
Discussion started by: azelinsk
7 Replies
2. Shell Programming and Scripting
How to read character by character using awk (6 Replies)
Discussion started by: karnan
6 Replies
3. Shell Programming and Scripting
Can someone help me to write a script / command to read in a file, character by character, replace any unknown ASCII characters with space. then write out the file to a new filename/
Thanks! (1 Reply)
Discussion started by: raghav525
1 Replies
4. Shell Programming and Scripting
Hello all respected people,
Can i read a file character by character without using sed,awk and perl commands.
Thanks in advance. (4 Replies)
Discussion started by: murtaza
4 Replies
5. Shell Programming and Scripting
Hello All,
We are getting files from sftp server through file transmission protocol & after transmission we are removing all the control M
(^M) characters from them.we are expecting various kind of special characters in the files.
we are tried removing '^M' characters through 'dos2unix' command... (2 Replies)
Discussion started by: Aquilis
2 Replies
6. Shell Programming and Scripting
Hi,
How read character by character from a file .
and i need replace '.' with null if it comes as a 5 character
i am beginner ...please help me (1 Reply)
Discussion started by: kartheek
1 Replies
7. Shell Programming and Scripting
hello all
i request you to give the solution for the following problem..
I want read the text file.and print the contents character by character..like if the text file contains google means..i want to print
g
go
goo
goog
googl
google
like this Using unix Shell scripting...
without using... (1 Reply)
Discussion started by: samupnl
1 Replies
8. Shell Programming and Scripting
Hello,
The last character is a comma ,
I have tried the following:
sed -e 's/\,$//' filename-to-read
however - there are still commas at the end of each line...:confused: (5 Replies)
Discussion started by: learning
5 Replies
9. Shell Programming and Scripting
Hi,
Maybe this iscorrect forum for my question...
I should read one character at a fixed position from each line of the file. So how ??? should be substituted in the code below:
while read line ; do
single_char=`???`
echo "$single_char"
done < $input_file
OK...I did get an... (0 Replies)
Discussion started by: arsii
0 Replies
10. Programming
performing this code to read from file and print each character in separate line
works well with ASCII encoded text
void
preprocess_file (FILE *fp)
{
int cc;
for (;;)
{ cc = getc (fp);
if (cc == EOF)
break;
printf ("%c\n", cc);
}
}
int
main(int... (1 Reply)
Discussion started by: khaled79
1 Replies
LEARN ABOUT DEBIAN
mcsender
MCSENDER(8) System Manager's Manual MCSENDER(8)
NAME
mcsender - Multicast test tool to send multicast test packets
SYNOPSIS
mcsender [-t<ttl>] [-i<interface>] ip:port
DESCRIPTION
mcsender sends multicast packets to the specified IPv4 or IPv6 multicast address and port. The packets sent contain the string "this is the
test message from mclab/mcsender
".
OPTIONS
-t<ttl>
Set the TTL (or hop limit for IPv6) to the specified value.
-i<interface>
Specify the interface to use for outgoing multicast datagrams.
EXAMPLES
To send datagrams to IPv4 multicast address 239.1.1.1 and port 12345 with a TTL of 3:
$ mcsender -t3 239.1.1.1:12345
To send datagrams to IPv4 multicast address 239.1.1.1 and port 12345 with a TTL of 3 out of interface eth1:
$ mcsender -ieth1 -t3 239.1.1.1:12345
To send datagrams to IPv6 multicast address ff15::1 and port 12345 with a hop limit of 3:
$ mcsender -t3 ff15::1:12345
To send datagrams to IPv6 multicast address ff15::1 and port 12345 with a hop limit of 3 out of interface eth1:
$ mcsender -ieth1 -t3 ff15::1:12345
AUTHOR
mcsender was written by Carsten Schill <carsten@cschill.de>.
Support for IPv6 was added by Todd Hayton <todd.hayton@gmail.com>.
This manual page was written by Julien BLACHE <jblache@debian.org>, for the Debian project (but may be used by others).
August 08, 2011 MCSENDER(8)