Setting Col size


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Setting Col size
# 1  
Old 01-17-2005
Setting Col size

I have a variable in a shell script which is more than 80 characters.
1) I log into SQL plus and populate a variable using 3 queries appended by ,' comma'.
ORAINFO=`sqlplus -s << !
/ as sysdba
set feedback off
set heading off
select LOG_MODE ||','||(select substr(VALUE,instr(VALUE,'=')+1) from V\\$PARAMETER where NAME='log_archive_dest_1')
||','||(select max(BYTES) from V\\$LOG ||','||(select VALUE from V\\$PARAMETER where NAME='background_dump_dest')
from V\\$DATABASE;
exit
!`

2) It gives a value ArchiveLOG,46464545434,/u05/app/oracle/product/8.1.6/admin/FCCLIVE/bdump. However it displays a space after FCCLIVE/, so effectively it becomes FCCLIVE/ bdump instead of FCCLIVE/dump.


Request your help;...
# 2  
Old 01-17-2005
You don't actually ask a question in your post....

What is your problem (is it the fact that there is a space in the output)?

And what is the solution you're looking for (is it to remove the space)?

If you're sure you won't get any legitimate spaces in your output you can just pipe ORAINFO through sed to remove the spaces thusly

Code:
NOSPACES=`echo "$ORAINFO" | sed 's/ //g'`

If that's not what you want please give a little more information....

Cheers
ZB
# 3  
Old 01-17-2005
yes sorry for the vague question.
I dont want the space in my variable o/p. However after I posted the thread, I was looking into sqlplus manual and there I found out what the problem was. SQLPLUS was limiting factor, not Unix Col size. So after setting linesize=100, it worked.

Thanks for the help rendered
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Modifying col values based on another col

Hi, Please help with this. I have several excel files (with and .xlsx format) with 10-15 columns each. They all have the same type of data but the columns are not ordered in the same way. Here is a 3 column example. What I want to do add the alphabet from column 2 to column 3, provided... (9 Replies)
Discussion started by: newbie83
9 Replies

2. Shell Programming and Scripting

Printing from col x to end of line, except last col

Hello, I have some tab delimited data and I need to move the last col. I could hard code it, awk '{ print $1,$NF,$2,$3,$4,etc }' infile > outfile but it would be nice to know the syntax to print a range cols. I know in cut you can do, cut -f 1,4-8,11- to print fields 1,... (8 Replies)
Discussion started by: LMHmedchem
8 Replies

3. UNIX for Advanced & Expert Users

Print line based on highest value of col (B) and repetion of values in col (A)

Hello everyone, I am writing a script to process data from the ATP world tour. I have a file which contains: t=540 y=2011 r=1 p=N409 t=540 y=2011 r=2 p=N409 t=540 y=2011 r=3 p=N409 t=540 y=2011 r=4 p=N409 t=520 y=2011 r=1 p=N409 t=520 y=2011 r=2 p=N409 t=520 y=2011 r=3 p=N409 The... (4 Replies)
Discussion started by: imahmoud
4 Replies

4. Shell Programming and Scripting

i can't cut the third col

SW_dist_intr false Enable SW distribution of interrupts True autorestart true Automatically REBOOT OS after a crash True boottype disk N/A False capacity_inc 1.00 ... (7 Replies)
Discussion started by: maxim42
7 Replies

5. Ubuntu

Match col 1 of File 1 with col 1 File 2 and create a 3rd file

Hello, I have a 1.6 GB file that I would like to modify by matching some ids in col1 with the ids in col 1 of file2.txt and save the results into a 3rd file. For example: File 1 has 1411 rows, I ignore how many columns it has (thousands) File 2 has 311 rows, 1 column Would like to... (7 Replies)
Discussion started by: sogi
7 Replies

6. AIX

setting default PP size

Does anyone know how to set PP (Physical Partition) size on rootvg when installing AIX OS from scratch (via CD or NIM installation)? (7 Replies)
Discussion started by: pdtak
7 Replies

7. Solaris

File size setting

There is a file in my Unix Server whose size will be constant. But every day when the sheduled jobs run in the server, that file gets updated but the size does not change. Upon doing file filename It is dispalyed as a binary file. Can anyone please explain how that file is created. How is... (3 Replies)
Discussion started by: exterminator
3 Replies

8. UNIX for Dummies Questions & Answers

Info about col command

Hello every1. Can any1 help me with the col command. Wat is a reverse line feed. Which kind of files u need to use the col command. (2 Replies)
Discussion started by: rahulrathod
2 Replies

9. UNIX for Advanced & Expert Users

Help On col command

Hello Can Any1 tell me the difference between the col command and the col command with the -f option. I tried running both of them but i can't see any difference. Please guide me. (1 Reply)
Discussion started by: rahulrathod
1 Replies

10. Shell Programming and Scripting

setting max log file size...

Hello all! I have found a new home, this place is great! I have been searching for days to find a way to set a max size for a log.txt file using a cron job exicuting a shell script. Is it possible for a script to remove older entries in a log file to maintain a limited file size? If so,... (5 Replies)
Discussion started by: v-rod
5 Replies
Login or Register to Ask a Question