11-30-2001
You could use the dos2unix command to take the ^M characters out.
do something like this:
dos2unix file > newfile
This will create a new file that is the same as your original file except without the ^M characters.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi All,
I am facing a strange situation and want to find why it is occuring . When i convert the whole line into Hexadecimal character i can find the junk value after new line (\n) . If i look in binary mode it is not visible.
PLease let me know how possible the junk character is added... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies
2. UNIX for Dummies Questions & Answers
Hello,
I have two AIX 5.3 servers that are supposedly set up exactly the same. The problem I am having is on one of the servers, it seems dynamic routes are being added mysteriously and non-periodically. This only happens on one server and not the other. Also, there doesn't seem to be a specific... (1 Reply)
Discussion started by: Conutmonky
1 Replies
3. Programming
Hi all,
I got trouble with reading and writing ( to standard input/output, file, socket whatever...).
I will briefly describe it by giving this example. I want to read a long string from keyboard but i don't know how long it is b4. So i need to know the number of character i will read first.... (6 Replies)
Discussion started by: tazan_007
6 Replies
4. UNIX for Advanced & Expert Users
I've posted about this before, but only recently narrowed the problem down to a specific cause.
Ok, first of all, the behavior:
It occurs when autocompletion brings up its list (not when there is only a single option). Basically, if I were to type, say,
cd ~/<TAB>
I would get something... (2 Replies)
Discussion started by: marshaul
2 Replies
5. Solaris
i am trying to patch a solaris 10 server using live upgrade.
issue is, when i create a new BE and activate it during reboot the file system that are mounted but doesnt have an entry in vfstab are automatically added in vfstab of new BE.
looks like live upgrade uses df -h output as reference... (0 Replies)
Discussion started by: chidori
0 Replies
6. Shell Programming and Scripting
Hi all,
I executed this script
top -n 1 | awk '{ if (NR==3) print $2 }'and it will give me in console
'31.6%us,'however, if I put the same script in txt file
top -n 1 | awk '{ if (NR==3) print $2 }' >> test.txtwhen I open the test.txt
I see
31.6%ESC(BESCI just actually need the 31.6 % to be... (1 Reply)
Discussion started by: peuceul
1 Replies
7. Shell Programming and Scripting
Dear All,
I have a directory when i received files by means of FTP, i want to invoke my shell scripts as soon as file hit the directory, if the files hit 10 times then the shell scripts should also get executed 10 times.
thanks
rajesh (1 Reply)
Discussion started by: guddu_12
1 Replies
8. Shell Programming and Scripting
Write a unix script to do the following automatically-
1. Identify the latest path version directory under: /data/cs/chk. The latest at this time is 15_1_3.
/data/cs/chk
…
drwxr-x--- 2 dba tms 4096 Jan 22 11:18 15_1_2
drwxr-x--- 2 dba tms 4096 Jan 22 11:18 15_1_3
2. Check for any new... (1 Reply)
Discussion started by: roy1912
1 Replies
9. Shell Programming and Scripting
Hi,
I am trying to sort a csv file which has say 10 lines each line having a row size that is upto 30183 no. of COLUMNS (Row length = 30183). There is a LINE FEED (LF) at the end of each line. When I try to sort this file say, based on the second FIELD using the below command,
sort -t ',' +1... (5 Replies)
Discussion started by: DHeisenberg
5 Replies
10. IP Networking
RHEL 7.0, IPV6
Scenario:
I have routed specific network using network scripts.
1. "ip -6 route show" shows that route has been added. ( with metric 1024)
2. Ping of the specific IP through that route is successful.
3. Now after few days, for some reason, we see that cache route appears for... (3 Replies)
Discussion started by: msr1981
3 Replies
gets(n) Tcl Built-In Commands gets(n)
__________________________________________________________________________________________________________________________________________________
NAME
gets - Read a line from a channel
SYNOPSIS
gets channelId ?varName?
_________________________________________________________________
DESCRIPTION
This command reads the next line from channelId, returns everything in the line up to (but not including) the end-of-line character(s), and
discards the end-of-line character(s).
ChannelId must be an identifier for an open channel such as the Tcl standard input channel (stdin), the return value from an invocation of
open or socket, or the result of a channel creation command provided by a Tcl extension. The channel must have been opened for input.
If varName is omitted the line is returned as the result of the command. If varName is specified then the line is placed in the variable
by that name and the return value is a count of the number of characters returned.
If end of file occurs while scanning for an end of line, the command returns whatever input is available up to the end of file. If chan-
nelId is in nonblocking mode and there is not a full line of input available, the command returns an empty string and does not consume any
input. If varName is specified and an empty string is returned in varName because of end-of-file or because of insufficient data in non-
blocking mode, then the return count is -1. Note that if varName is not specified then the end-of-file and no-full-line-available cases
can produce the same results as if there were an input line consisting only of the end-of-line character(s). The eof and fblocked commands
can be used to distinguish these three cases.
EXAMPLE
This example reads a file one line at a time and prints it out with the current line number attached to the start of each line.
set chan [open "some.file.txt"]
set lineNumber 0
while {[gets $chan line] >= 0} {
puts "[incr lineNumber]: $line"
}
close $chan
SEE ALSO
file(n), eof(n), fblocked(n), Tcl_StandardChannels(3)
KEYWORDS
blocking, channel, end of file, end of line, line, nonblocking, read
Tcl 7.5 gets(n)