Removal of space


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Removal of space
# 8  
Old 01-12-2018
Post the output of below after running the modified script:-
Code:
tail /u01/script/latest/tbs.sql | cat -evt

# 9  
Old 01-12-2018
Code:
select file_name from dba_data_files where tablespace_name = 'SYSTEM^I^I^I^I';$
select file_name from dba_data_files where tablespace_name = 'SYSAUX^I^I^I^I';$


Last edited by Don Cragun; 01-12-2018 at 06:15 PM.. Reason: Add CODE tags, again.
# 10  
Old 01-12-2018
Ok, replace below line in your code:-
Code:
while IFS= read -r LINE; do

to
Code:
while read LINE; do

This User Gave Thanks to Yoda For This Post:
# 11  
Old 01-12-2018
Thanks boss

working thanks a lot. salute to you

got out from one issue will face many more.

thanks for help

---------- Post updated at 12:17 AM ---------- Previous update was at 12:04 AM ----------

Hi,

can u please tell me :

i want to cut only path

eg:
Code:
/u01/app/oracle/oradata/DB11G/system01.dbf

and i want only path not file name whatever may be length of path. it should only give path not file name.
it should give
Code:
/u01/app/oracle/oradata/DB11G/


Last edited by Don Cragun; 01-12-2018 at 06:17 PM.. Reason: Add CODE tags, again.
# 12  
Old 01-12-2018
Code:
man dirname

# 13  
Old 01-12-2018
Assuming it is stored in variable pathstring, the following does it
Code:
${pathstring%/*}/

# 14  
Old 01-13-2018
Code:
[oracle@localhost latest]$ cat check_tablespace.temp
USERS                                   5        960      18.75          0
SYSAUX                                630     130688 20.2579365        -38
EXAMPLE                               100      21760      21.25         -7
SYSTEM                                890     209984 23.0407303        -84
UNDOTBS1                               95      55744 57.3026316        -47
NOONE                                1024    1047552 99.9023438      -1022



no when cut and get output from check_tablespace.temp

i get

Code:
USERS                                   5
SYSAUX
EXAMPLE
SYSTEM
UNDOTBS1
NOONE
6


i dont want 5 and 6

---------- Post updated at 12:08 PM ---------- Previous update was at 12:07 PM ----------

Code:
$(cat /u01/script/latest/check_tablespace.temp | cut -d' ' -f1 | sed '/^\s*$/d' >>/u01/script/latest/tbs.temp)

this is what i use to trim my log file

Last edited by Scrutinizer; 01-13-2018 at 03:09 AM.. Reason: code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Web Development

Vbseo removal

first off i want to thank you for such a great site, you helped me narrow down a long search on what was wrong with my forum, i have a large forum motorbicycling DOT com which i had someone remove vbseo before they went under because of all the security problems. anyway i have lots of 404 errors... (13 Replies)
Discussion started by: atcspaul
13 Replies

2. UNIX for Advanced & Expert Users

Duplicate removal

I have an input file of 5GB which contains duplicate records and have to remove duplicate records by retaing first instance of that record . Based on 5 fields the duplicates has to be removed . Kindly request to help me in writing a Unix Script. Thanks Asim (11 Replies)
Discussion started by: duplicate
11 Replies

3. Shell Programming and Scripting

Undesired removal of white space with awk

Hi, I'm fairly new to scripting and I have a problem that I am having difficulty solving. What I'd like to do is run an awk script to adjust the string in the first field depending on the string in another field. This is best explained with an example: Here is my script: cat... (4 Replies)
Discussion started by: calbrex
4 Replies

4. UNIX for Dummies Questions & Answers

removal of space from the end

HI, I need the help from the experts like I have created one file with text like: Code: a b c de f g hi j k l So my question is that i have to write the script in which like in the first sentence it will take only one space after d and remove all the extra space in the end.I dont... (0 Replies)
Discussion started by: bhanudhingra
0 Replies

5. Shell Programming and Scripting

\n removal between two |

I have a multi-line string I'm trying to do some clean-up on. Example: 1|575|67866|"fgnhdgj"|"afhgajh agfajgf ahfjhgfk ahfkhf"|568 2|56|5435|"mayank"|"gupta gdja agdjagf"|677 3|5666|5435|"mayank"|"gupta gdja agdjagf"|677 I need a shell script that replace all \n under " ". (11 Replies)
Discussion started by: mayankgupta18
11 Replies

6. UNIX for Dummies Questions & Answers

semaphore removal

I have one process which creates semaphore with permission 600. Then at some part of the code I have line where this semaphore will be removed. Problem I have is that other processes in my program also try to execute this line of code. Of course since they dont have permission they wont be able to... (1 Reply)
Discussion started by: joker40
1 Replies

7. Homework & Coursework Questions

removal of files?

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: remove all files and only files that the first three characters start with numerals. 2. Relevant commands,... (6 Replies)
Discussion started by: linuxtraining
6 Replies

8. Shell Programming and Scripting

Calculate total space, total used space and total free space in filesystem names matching keyword

Good afternoon! Im new at scripting and Im trying to write a script to calculate total space, total used space and total free space in filesystem names matching a keyword (in this one we will use keyword virginia). Please dont be mean or harsh, like I said Im new and trying my best. Scripting... (4 Replies)
Discussion started by: bigben1220
4 Replies

9. UNIX for Dummies Questions & Answers

Removal of Data

Hi All, (And first up, a Happy New Year to you all! 363 days to go!) I need to make sure that our old Sun Sparcstations and Servers are clear of any Confidential data before I return them... Suggestions? I'm formatting the discs to make sure that there's nothing obvious, but would... (5 Replies)
Discussion started by: geralex
5 Replies

10. UNIX for Dummies Questions & Answers

Removal

I am using Unix as my OS on my server and would like to format my hard drive. How do I go about wiping my hard drive or is there a removal tool that I can use? (1 Reply)
Discussion started by: anaconda
1 Replies
Login or Register to Ask a Question