Sponsored Content
Full Discussion: Use of grep within scripts
Top Forums Shell Programming and Scripting Use of grep within scripts Post 302304579 by abdurrouf on Monday 6th of April 2009 08:33:52 PM
Old 04-06-2009
Thank you Gunther & gsiva, here is more clarification of my requirement:
The output of "ct lsview -s" command is (example):
agutierr_EPASUE
Arajurka_CTI_Source_Rel_2.0_Integration
bbaldwin_bbaldwin_JSPTagLib_Rel_2.2.2_Project
vpurohit_ResultsReview_Rel_2.0_Project_int
apathy_PAA_Alaka_Testing_2
mkrishna_AOL_VAJava_1.1.8_Project_DEV3
mkrishna_AOL_VAJava_1.1.8_Project_DEV_int
mchezhia_CTI_Rel_1.0_Project_3_int
abharade_CTI_Rel_1.0_Project_int
Awilkin3_Trial
bbaldwin_JSPTagLib_Rel_2.2.2_Project_int
bbaldwin_JSPtag2_2
bbaldwin_JSPTagLib_Rel_2.2.2_Project_Integration

from I've to grab the lines staring with a & A, if I use the command

ct lsview -s | grep ^a

This works, but when I use this command in a script, then didn't work, here is the script part example:

$access_info="view_infoa.csv"; # Output file

# list of views on s199ap700
@view_lista = `cleartool lsview -short | egrep ^a`;

# for each view, do a full properties
# and get the appropriate information
open (ACCESS_INFO, ">$access_info") || die "Cannot open/create output file $access_info.";
$num_of_views=@view_lista;
print(ACCESS_INFO "SHORT NAME,OWNER,LAST ACCESS DATE,LAST ACCESS TIME,LAST ACCESS USER\n");
for ($i=0;$i < $num_of_views; $i++)
{
@description = `cleartool lsview -full -properties @view_lista[$i]`;
$len_of_desc=@description;


Any help is greatly appreciated.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shell scripts to grep dn in ldif file

Hi gurus out there, 1)I am using ksh, in solaris 10. 2)I have one ldif file, I need to output user DN with attributes=<some pattern> to a file. Example: dn: uid=joy,ou=People,o=abc.com,o=isp nswmExtendedUserPrefs: meAutoSign=true nswmExtendedUserPrefs: meSignature=Regards, Joy... (3 Replies)
Discussion started by: bulkbiz
3 Replies

2. Shell Programming and Scripting

multiple child scripts running in backgroud, how to use grep on the parent?

Hi I have a shell script A which calls another 10 shell scripts which run in background. How do i make the parent script wait for the child scripts complete, or in other words, i must be able to do a grep of parent script to find out if the child scripts are still running. My Code: ... (5 Replies)
Discussion started by: albertashish
5 Replies

3. UNIX for Dummies Questions & Answers

Profile scripts versus rc scripts....

what is the difference between login and profile scripts versus the rc scripts? (1 Reply)
Discussion started by: rookie22
1 Replies

4. Shell Programming and Scripting

Help with Script using rsh and scripts within scripts

Hi, I've written a script that runs on a Database server. It has to shutdown the Application server, do an Oracle Dump and then restart the Application server. Its been a long time since I wrote any shells scripts. Can you tell me if the scripts that I execute within my script will be executed... (3 Replies)
Discussion started by: brockwile1
3 Replies

5. Shell Programming and Scripting

Running scripts within scripts from cron

Hi all, I have set up a cron job which calls another shell script shell script which in turn calls a Java process. The cron tab looks so. 0,30 7-18 * * 1-5 /u01/home/weblogic/brp/bin/checkstatus.sh >> /u01/home/weblogic/logs/checkstatus.log The checkstatus.sh scripts looks like this. ... (4 Replies)
Discussion started by: sirbrian
4 Replies

6. Shell Programming and Scripting

Changing the Bash Scripts to Bourne Scripts:URGENT

Hi, I have to write a program to compute the checksums of files ./script.sh I wrote the program using bash and it took me forever since I am a beginner but it works very well. I'm getting so close to the deadline and I realised today that actually I have to use normal Bourne shell... (3 Replies)
Discussion started by: pgarg1989
3 Replies

7. UNIX for Dummies Questions & Answers

Use of grep with multiple parameters in shell scripts

I am learning how to write shell scripts and have come across an issue. I'm trying to write a script that looks for a directory called public_html, and if it finds one, to print the number of lines that contain applet tags (containing '<applet') in all files that end in either .html or .htm that... (7 Replies)
Discussion started by: feverdream
7 Replies

8. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

Dear Members, I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc. I would like to create a script which will will call other scripts based on the request action. Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies

9. OS X (Apple)

Need Help with GREP REGEX scripts for common BB-EDIT text-editing

Hi Everybody.. I'm a "newbie" to using Command-line... A few half-remembered DOS commands from 30 years ago, and the very handy "Sudo rm -R pathname" REMOVE command... I do a lot of "cleaning" of plain-text OCR text files. with assorted common line-break, punctuation and capitalization... (1 Reply)
Discussion started by: TheMacGuy
1 Replies

10. Shell Programming and Scripting

Calling multiple scripts from another scripts

Dear all, I am working on script which call other shell scripts in a loop but problem is from second script am not able to come out. Here is the snippet:- #!/bin/bash HSFILE=/root/Test/Components.txt LOGFile=/opt/domain/AdminDomain/application/logs... (3 Replies)
Discussion started by: sharsour
3 Replies
DBIx::Class::Storage::DBI::ODBC::ACCESS(3)		User Contributed Perl Documentation		DBIx::Class::Storage::DBI::ODBC::ACCESS(3)

NAME
DBIx::Class::Storage::DBI::ODBC::ACCESS - Support specific to MS Access over ODBC DESCRIPTION
This class implements support specific to Microsoft Access over ODBC. It is a subclass of DBIx::Class::Storage::DBI::ODBC and DBIx::Class::Storage::DBI::ACCESS, see those classes for more information. It is loaded automatically by DBIx::Class::Storage::DBI::ODBC when it detects a MS Access back-end. This driver implements workarounds for "IMAGE" and "MEMO" columns, and DBIx::Class::InflateColumn::DateTime support for "DATETIME" columns. EXAMPLE DSN
dbi:ODBC:driver={Microsoft Access Driver (*.mdb, *.accdb)};dbq=C:Users kitoverDocumentsaccess_sample.accdb TEXT
/IMAGE/MEMO COLUMNS Avoid using "TEXT" columns as they will be truncated to 255 bytes. Some other drivers (like ADO) will automatically convert "TEXT" columns to "MEMO", but the ODBC driver does not. "IMAGE" columns work correctly, but the statements for inserting or updating an "IMAGE" column will not be cached, due to a bug in the Access ODBC driver. "MEMO" columns work correctly as well, but you must take care to set LongReadLen to "$max_memo_size * 2 + 1". This is done for you automatically if you pass LongReadLen in your connect_info; but if you set this attribute directly on the $dbh, keep this limitation in mind. AUTHOR
See "AUTHOR" in DBIx::Class and "CONTRIBUTORS" in DBIx::Class. LICENSE
You may distribute this code under the same terms as Perl itself. perl v5.18.2 2014-01-05 DBIx::Class::Storage::DBI::ODBC::ACCESS(3)
All times are GMT -4. The time now is 08:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy