Sponsored Content
Full Discussion: split a line using a token
Top Forums Shell Programming and Scripting split a line using a token Post 302264398 by danmero on Wednesday 3rd of December 2008 11:31:07 PM
Old 12-04-2008
Use double quotes.
Code:
# var=$(grep response file)
# echo $var
[12/4/08 16:18:31:298 NZDT] 4c4a8d responseTime [307 millis] [12/4/08 16:19:47:005 NZDT] 1affb08 responseTime[692 millis] [12/4/08 16:19:47:416 NZDT]1affb08 responseTime[692 millis]
# echo "$var"
[12/4/08 16:18:31:298 NZDT] 4c4a8d responseTime [307 millis]
[12/4/08 16:19:47:005 NZDT] 1affb08 responseTime[692 millis]
[12/4/08 16:19:47:416 NZDT]1affb08 responseTime[692 millis]

 

10 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

line 3: syntax error near unexpected token `('

Hi All I've used UNIX in the past experimenting with commands through terminal but thats about it. Im now currently teaching myself "C". Using a book from the library, the first chapter asks you run and compile your program from a command-line prompt. As you will see the program is very simple,... (4 Replies)
Discussion started by: camzio
4 Replies

2. Shell Programming and Scripting

Split a line on positions before reading complete line

Hi, I want to split before reading the complete line as the line is very big and its throwing out of memory. can you suggest. when i say #cat $inputFile | while read eachLine and use the eachLine to split its throwing out of memory as the line size is more than 10000000 characters. Can you... (1 Reply)
Discussion started by: vijaykrc
1 Replies

3. Shell Programming and Scripting

split single line into two line or three lines

Dear All, I want to split single line into two line or three lines wherever “|” separated values comes using Input line test,DEMTEMPUT20100404010012,,,,,,,,|0070086|0070087, output shoule be test,DEMTEMPUT20100404010012,,,,,,,,0070086, test,DEMTEMPUT20100404010012,,,,,,,,0070087, (14 Replies)
Discussion started by: arvindng
14 Replies

4. Shell Programming and Scripting

Split a line

I guess this has a simple solution but can't figure out now. having: x="H:a:b:c" to get H: echo $x|awk -F: {'print $1'} how can I put REST of line in another one? i.e. echo $rest a:b:c thanks ---------- Post updated at 08:58 PM ---------- Previous update was at... (5 Replies)
Discussion started by: garagonp
5 Replies

5. Shell Programming and Scripting

Cannot execute/finish script because of last line syntax error: unexpected end of file/token `done'

first of all I thought the argument DONE is necessary for all scripts that have or begin with do statements which I have on my script, However, I still don't completely understand why I am receiving an error I tried adding another done argument statement but didn't do any good. I appreciate... (3 Replies)
Discussion started by: wolf@=NK
3 Replies

6. Shell Programming and Scripting

sed - Removing all characters from token to end of line

Hello. The token is any printable characters between 2 " . The token is unknown, but we know that it is between 2 " Tok 1 : "1234x567" Tok 2 : "A3b6+None" Tok 3 : "A3b6!1234=@" The ligne is : Line 1 : "9876xABCDE"Do you have any code fragments or data samples in your post Line 2 : ... (3 Replies)
Discussion started by: jcdole
3 Replies

7. Shell Programming and Scripting

sed - How to insert line before the first blank line following a token

Hello. I have a config file (/etc/my_config_file) which may content : # # port for HTTP (descriptions, SOAP, media transfer) traffic port=8200 # network interfaces to serve, comma delimited network_interface=eth0 # set this to the directory you want scanned. # * if have multiple... (6 Replies)
Discussion started by: jcdole
6 Replies

8. Shell Programming and Scripting

Read a File line by line and split into array word by word

Hi All, Hope you guys had a wonderful weekend I have a scenario where in which I have to read a file line by line and check for few words before redirecting to a file I have searched the forum but,either those answers dint work (perhaps because of my wrong under standing of how IFS... (6 Replies)
Discussion started by: Kingcobra
6 Replies

9. Shell Programming and Scripting

Split a line

I have a very long line in a file separated by "|" delimiter like below. Due to the length of the line, I find it very difficult to read to find a match line. file = temp.txt word 1| word 2 | word 3|.... I would like to read the file temp.txt and print out all words line by line like... (1 Reply)
Discussion started by: boldnbeautiful
1 Replies

10. Programming

Sh: -c: line 0: syntax error near unexpected token `(' how to resolve this

Below query is not working for me. Please help me on this DATA EXCLUDE STATEMENT: TABLE:\"LIKE \'%\_HISTORY\'\", TABLE:\"LIKE \'%\_HIST\'\", TABLE:\"in \(select tname from tab where REGEXP_LIKE(TNAME,\'\_H$\'\))\", TABLE:\"LIKE \'%\_LOG\'\", TABLE:\"LIKE \'DW\_%\'\", TABLE:\"LIKE... (1 Reply)
Discussion started by: princy
1 Replies
IPTOTAL_CONFIG(5)						File Formats Manual						 IPTOTAL_CONFIG(5)

NAME
iptotal_config - iptotal configuration file SYNOPSIS
/etc/iptotal.cfg DESCRIPTION
iptotal reads configuration data from /etc/iptotal.cfg (or the file specified with -c on the command line). The file contains keyword- argument pairs, one per line. Lines starting with '#' and empty lines are interpreted as comments. The possible keywords and their meanings are as follows (note that keywords are case-insensitive and arguments are case-sensitive): debug <level> Debug level: 0 - no debuging; 1 - summary; 3 - all packets captured. The default is 0. interface <interface> Interface iptotal is to monitor. The default is eth0. filter <filterstr> Use pcap filters (see tcpdump). fork <choice> "no" to run in foreground, "yes" in background. The default is "no". maskbits <maskbits> Set number of network mask bits (1-32) for subnet traffic aggregation. Default is 24 (255.255.255.0). report <seconds> Reporting period - number of seconds, default 300. FILES
/etc/iptotal.cfg File that defines the configuration used to invoke iptotal(1). AUTHOR
Written by Antoine Megens <webmaster@dingetje.homeip.net> Manpage written by Millis Miller <millis@faztek.org> REPORTING BUGS
Report bugs to <webmaster@dingetje.homeip.net> COPYRIGHT
Copyright (C) 2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. SEE ALSO
iptotal(1), iptotald(8), tcpdump (1) iptotal 0.3.2 Dec 2003 IPTOTAL_CONFIG(5)
All times are GMT -4. The time now is 05:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy