Linux / UNIX Tech Support Forum
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: ...
|
|||||||
| 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. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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? |
| Sponsored Links | ||
|
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| problem with System + MySQL backup script | massoo | Shell scripting | 1 | 20-08-2007 09:50 PM |