nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

problem in script

This is a discussion on problem in script within the Getting started tutorials forums, part of the Linux Getting Started category; Hi all, I want to parse files from bit keeper command’s output. This command gives output something like below, Client/webnms/screens/vmg/SVmgMms.java: ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Getting started tutorials

Linux answers from nixCraft.


Getting started tutorials So much to read, so little time! If that is your problem, we have solution. Read our FAQ and tutorials to help you cut through the clutter of information overload. Only members of "contributors" group can post new tutorials. Other members can just reply to thread.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 14-09-2007, 04:25 PM
Junior Member
User
 
Join Date: Sep 2007
OS: Debian
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
sania is on a distinguished road
Default problem in script

Hi all,

I want to parse files from bit keeper command’s output.
This command gives output something like below,

Client/webnms/screens/vmg/SVmgMms.java: 1.6 1.7 sture 07/09/13 09:37:11
Client/webnms/screens/vmg/SVmgMmsConfig.java: 1.4 1.5 sture 07/09/13 09:37:19
Server/configupdate/configupdateimpl.cc: 1.34 1.35 sture 07/09/13 10:05:30


Now I want to separate out java and cc file names (only names)
So I created command

bk -Rr info' | awk '{print $1}' | tr ':' ' ' | grep '.cc’ ---- for cc files

bk -Rr info' | awk '{print $1}' | tr ':' ' ' | grep '.java’ ---- for java files

Which works nicely on command prompt. But now I want to put them in script so I wrote following lines,


LS=`bk -Rr info`
OP=`$LS | awk '{print $1}' | tr ':' ' ' | grep '.java'`
echo $OP


But it is giving op as follows,

./script3.sh: Client/webnms/screens/vmg/SVmgMms.java:: No such file or directory

Client/webnms/screens/vmg/SVmgMms.java Client/webnms/screens/vmg/SVmgMmsConfig.java Server/configupdate/configupdateimpl.cc
Client/webnms/screens/vmg/SVmgMms.java: /bin: is a directory
Client/webnms/screens/vmg/SVmgMms.java: 3rdparty: command not found
: command not foundns/vmg/SVmgMms.java: *
Client/webnms/screens/vmg/SVmgMms.java: 3rdparty: command not found
: command not foundns/vmg/SVmgMms.java: *
Client/webnms/screens/vmg/SVmgMms.java: 3rdparty: command not found


What is mistake here?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
problem with System + MySQL backup script massoo Shell scripting 1 20-08-2007 09:50 PM


All times are GMT +5.5. The time now is 04:20 PM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38