I want to remove the newline before the </script>
in my HTML file with a Linux command (sed
, awk
...).
Sample input:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JavaScript Ders 2</title>
<script type="text/javascript" src="script1.js" language="javascript">
</script>
<script type="text/javascript" src="script2.js" language="javascript">
</script>
<script>
// script kodumuz buraya yazılacak
</script>
</head>
<body>
<script type="text/javascript" src="script3.js" language="javascript">
</script>
</body>
</html>
Sample output:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JavaScript Ders 2</title>
<script type="text/javascript" src="script1.js" language="javascript"> </script>
<script type="text/javascript" src="script2.js" language="javascript"> </script>
<script>
// script kodumuz buraya yazılacak</script>
</head>
<body>
<script type="text/javascript" src="script3.js" language="javascript"> </script>
</body>
</html>
I tried different syntax, but none of them could do.