Sponsored Content
Full Discussion: Remove space
Top Forums Shell Programming and Scripting Remove space Post 302436182 by sandy1028 on Friday 9th of July 2010 12:49:18 PM
Old 07-09-2010
Remove space

DATE=6/Jul/2010
6/Jul/2010
var="sed -n '/\[$DATE:06:00:00/,/\[${DATE1}:09:00:00/p"
echo $var

sed -n '/\[ 6/Jul/2010:06:00:00/,/\[ 7/Jul/2010:09:00:00/p

Please tell me how to remove the space between '[' and 6 and [ and 7.

---------- Post updated at 11:49 AM ---------- Previous update was at 11:36 AM ----------

Code:
#!/bin/bash
DATE=`./get_date.pl 3`
DATE1=`./get_date.pl 2`
var1=$( echo "$DATE" | sed "s/ //g" )
var2=$( echo "$DATE1" | sed "s/ //g" )
var="sed -n '/\[$var1:06:00:00/,/\[${var2}:09:00:00/p"
echo $var
sort -k4 tmp.tsv | $var > tab.tsv

Please tell me why I get this error.


Code:
sed -n '/\[6/Jul/2010:06:00:00/,/\[7/Jul/2010:09:00:00/p
sed: -e expression #1, char 1: unknown command: `''

DATE=6/Jul/2010
DATE1=7/Jul/2010
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

remove space characters

hello I have this output ifspeed 100000000 ifspeed 100000000 collisions 413 collisions 10 duplex full duplex ... (1 Reply)
Discussion started by: melanie_pfefer
1 Replies

2. Shell Programming and Scripting

How to remove space in between the result

Hi All, How do i remove the spaces in between, the outputted result: my output is like below and i dont want spaces between them, how do i do that. I am enclosing the peice of code that does that:- if ; then $ECHO "The Path is:" $OFFERING_FILE_PATH/$z $ECHO $Z else $ECHO "" fi... (10 Replies)
Discussion started by: asirohi
10 Replies

3. UNIX for Dummies Questions & Answers

Space in file how to remove

Hello I have a file with data something like this in it : texttexttext "text .lst" TEXT=" text " texttexttext "moretext .lst" TEXT=" text " Question is how do I get rid of space so that the files looks like this : texttexttext "text.lst" TEXT="text" texttexttext... (8 Replies)
Discussion started by: davebw
8 Replies

4. Shell Programming and Scripting

Remove last space in a string?

I have a customer file now and would like to separate the names into two cells in a spreadsheet. Here is my data as an example: SHAWN R KEEGAN shawn r scroggin Shawn Regan Shawn Reilly The first two have the middle initial so I'd like to include them in the "first name" field and the last... (11 Replies)
Discussion started by: Grassy
11 Replies

5. Shell Programming and Scripting

remove space of each line

Hi Guys, I want remove starting space of each line ... My Input: A B C D E C V F G H F R T Y U D F G H J L O I U Y G P O K O P L O L O I P P O P P P P P My Output: A B C D E C V F G H (7 Replies)
Discussion started by: asavaliya
7 Replies

6. Shell Programming and Scripting

remove space

File A.txt A005 -119.5 -119.5 -100.5 A006 -120.5 -119.5 -119.3 A008 0 0 0 Output A005 -119.5 -119.5 -100.5 A006 -120.5 ... (1 Reply)
Discussion started by: asavaliya
1 Replies

7. UNIX for Advanced & Expert Users

Need to remove leading space from awk statement space from calculation

I created a awk state to calculate the number of success however when the query runs it has a leading zero. Any ideas on how to remove the leading zero from the calculation? Here is my query: cat myfile.log | grep | awk '{print $2,$3,$7,$11,$15,$19,$23,$27,$31,$35($19/$15*100)}' 02:00:00... (1 Reply)
Discussion started by: bizomb
1 Replies

8. Shell Programming and Scripting

Remove space from numeric value

Hello, I need help. I have xml file and there are one extra space on number <EpiReference>1 42345</EpiReference>. And of cource, the value change on every new file. I need remove space from that value what is in between <EpiReference> and </EpiReference>. How I can do that? This are example... (9 Replies)
Discussion started by: Jopsulainen
9 Replies

9. UNIX for Beginners Questions & Answers

Remove space with sed

Hello Folks , myfile contains 1000000 records as follows: logver=56 idseq=63256 itime=1111 devid=TG-40 devname=PUI-C2 vd=USER date=2019_01_10 time=18:39:49 logid="000013" type="traffic" subtype="forward" level="notice" eventtime=134 srcip=1.1.1.1 srcport=1 srcintf="XYX-CORE.01"... (3 Replies)
Discussion started by: arm
3 Replies

10. Programming

Python 3 remove the space after the last /

using python 3 when i run this code to get the urls i get a space in the url how do i remove the space after the last / thanks # Import libraries import requests from bs4 import BeautifulSoup # Connect to the URL page = requests.get('https://www.meihoski.co.jp/movie/') soup... (3 Replies)
Discussion started by: bob123
3 Replies
SHTOOLIZE.TMP(1)					      GNU Portable Shell Tool						  SHTOOLIZE.TMP(1)

NAME
shtoolize - Build individual GNU shtool scripts VERSION
GNU shtool 2.0.8 (18-Jul-2008) SYNOPSIS
shtoolize [-h] [-v] [-q] [-o script] module [ module ... ] DESCRIPTION
The shtoolize program builds individual GNU shtool scripts (written to the default output file "shtool" or to the specified script) out of one or more shtool ingredient modules. Available modules are: echo Print string with optional construct expansion mdate Pretty-print modification time of a file or dir table Pretty print a field-separated list as a table prop Display progress with a running propeller move Move files with simultan substitution install Install a program, script or datafile mkdir Make one or more directories mkln Make link with calculation of relative paths mkshadow Make a shadow tree fixperm Fix file permissions inside a source tree rotate Rotate a logfile tarball Roll distribution tarballs subst Apply sed(1) substitution operations platform Platform identification utility arx Extended archive command slo Separate linker options by library class scpp Sharing C Pre-Processor version Generate and maintain a version information file path Deal with program paths Additionally there is a pseudo-module ``"all"'' which can be used as a short-hand for ``"echo mdate table prop move install mkdir mkln mkshadow fixperm platform arx slo scpp version path"'', i.e. to build a shtool script with all modules in the standard order. An installed shtool is usually built this way via ``"shtoolize -o shtool all"''. Use the shtoolize program to build individual shtool scripts in case you want a smaller sized script and you don't need all of the available shtool functionality. For instance for the classical Autoconf based free software package a "shtool" script build via ``"shtoolize -o shtool install mkdir"'' might be sufficient. OPTIONS
The following command line options exist: -h Displays a short help page describing the usage of shtoolize. -v Displays the version number of shtoolize/shtool. -q Displays no processing information. -o script Writes the output to file script instead to file ``"shtool"''. EXAMPLE
The typical free software package which is based on GNU libtool and GNU shtool one uses a "Makefile" entry like the following: # Makefile entry for upgrading GNU tools upgrade-tools: libtoolize -f -c shtoolize -q all This upgrades the three files "ltmain.sh", "ltconfig" and "shtool" in the current source tree to the latest versions. SEE ALSO
shtool(1). AUTHOR
Ralf S. Engelschall rse@engelschall.com www.engelschall.com 18-Jul-2008 shtool 2.0.8 SHTOOLIZE.TMP(1)
All times are GMT -4. The time now is 06:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy