help needed for a shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting help needed for a shell script
# 1  
Old 12-11-2008
help needed for a shell script

i need to search the starting line

example we have

-sh
shl-js-gd

i need to search only starting -sh not the other

i have used cmd
cat filename | grep '-'

but it will check for complete - in the file
please help me to search only starting -

thank u
revenna
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script - help needed

I want to take out the Z1 value from the lscfg outpu and use the below command to get it lscfg -vl hdisk0 | grep "Device Specific.(Z1)" | awk -F. '{print $NF}' # lscfg -vpl hdisk0 . . Device Specific.(Z0)........0000063268181002 Device Specific.(Z1)........020064a . And it works,... (2 Replies)
Discussion started by: moorthikv
2 Replies

2. Shell Programming and Scripting

Help needed with shell script

Hi, I have trouble building the logic for the following, could anyone please help me out with this: Im working on a wrapper script to check for input files (in a specific directory) and pass the input files along with the options as parameters to the main script.The options vary depending ... (2 Replies)
Discussion started by: stunnerz_84
2 Replies

3. UNIX for Dummies Questions & Answers

Help needed with Shell script

Hi I want a script which should basically do 1. If the size of the file is 0kb, send email to some list od ppl 2. if the size of the file is other than 0kb send email to someother list... Pls help (2 Replies)
Discussion started by: win4luv
2 Replies

4. Shell Programming and Scripting

Help Needed on shell script

#!/bin/sh #Displaying every argument while ; do echo Moving file $0; shift; done exit 0; For the above script i get the below o/p when 2 arguments are passed when invoking the script dmlFileCopy.sh: line 3: Can you let me know how to rectify the error? (2 Replies)
Discussion started by: Anand86
2 Replies

5. Shell Programming and Scripting

Help needed with Shell script

Hi all, I need to modify the below highlighted piece to perform the below task. Please let me know as i am not able to figure out a way to do this. || FILENAME=$(date +"$FILENAME") if ; then do_log FATAL "FILENAME needs to be set if SWITCH2=0" exit 1 fi... (3 Replies)
Discussion started by: stunnerz_84
3 Replies

6. Shell Programming and Scripting

Help needed in shell script

i am trying to read an existing xml file and find an element in the xml file of following format <home.dir value="/local/mnt/homes/docs"/> I am trying to take a command line argument to my shell script whose value should replace /local/mnt/homes/docs in xml document. Can you please point me how... (3 Replies)
Discussion started by: viswas
3 Replies

7. Shell Programming and Scripting

Help with Shell Script Needed

Hi all, I'm a newbie. I'm thinking of making a shell script which will list a directory for *.csv files and merge all the files into a single file called data.csv. However, i have no idea how to. What i do currently is to manually issue the following command to merge multiple CSV files into... (1 Reply)
Discussion started by: infinity2030
1 Replies

8. Shell Programming and Scripting

Help needed for Shell Script.....

Hello Friends, Can you pls advice me on the following requirement: What we'd like to achieve is the following: - having a password.properties file which contains some passwords, e.g. BOT_PASSWORD=dog.name - in the configuration file, insert as the password value something like... (0 Replies)
Discussion started by: pulkit
0 Replies

9. UNIX for Dummies Questions & Answers

shell script Help Needed!!

Hi guys-- Here is the interesting problem.. I have a folder, which has a couple of xml files like ( could be anywhere under the sub folders) ABCD_NA.xml XAYSGD_SC.xml CBV_CA.xml etc I need to peek in each of these xml's and see that the pattern before the _ and after the _ are there... (0 Replies)
Discussion started by: smallu
0 Replies

10. Shell Programming and Scripting

Help needed in Shell Script

Hi I have the following columns in my input file which is sorted on ColA colA colB colC colD colE The data is such that for a single colA it can have multiple values of other columns, for eg the data can be colA colB colC ... (1 Reply)
Discussion started by: nvuradi
1 Replies
Login or Register to Ask a Question
CG(1)																	     CG(1)

NAME
cg - Recursively grep for a pattern and store it. SYNOPSIS
cg [ -l ] | [ [ -i ] pattern [ files ] ] DESCRIPTION
cg does a search though text files (usually source code) recursively for a pattern, storing matches and displaying the output in a human- readable fashion. It is intended to give some of the functionaly of AT&T's cscope(1) tool, with the advantages of simplicity and not being language-specific. The script will colorize output if configured as such. It is typically run with a Perl regular expression to search for. The search can be made case insensitive by using the -i option. A list of files may also be specified with an additional argument after the pattern. Put the files pattern in quotes to make it be matched by Perl rather than by the shell. Running the script with no arguments will recall the results of the previous search. After the search, entries found can be edited using the vg(1) script. The -l option shows the last log made. SOME EXAMPLES
cg - alone recalls the previous search results. cg -i pattern - search the default list of files for all files matching the pattern (and case-insensitively). cg pattern '*.c' - search recursively for pattern in all *.c files. This automatically converts '*' to '.*' and '.' to '.' for you and does a Perl pattern match on all files in the tree. cg pattern *.c - search through the shell-expanded list of *.c files, so not done recursively (in other words, only the files your shell pass to the script as arguments). cg -l - show the last log made. COMMAND-LINE OPTIONS -i Do a case-insensitive search. -l Show the last log made. -p Toggle the default pager option. cg has a bulit-in pager function, which can be enabled or disabled by default (in .cgvgrc). If the default is enabled, this option disables the pager; if the default is disabled, this option enables it. -P Force the built-in pager to be disabled. FILES
${HOME}/.cglast Log file of the last search. ${HOME}/.cgvgrc Per-user configuration file (if the defaults are not desireable). ${HOME}/.cgvg/* Log files in $HOSTNAME.shell_pid form with the log of the last search. SEE ALSO
vg(1), perl(1), find(1), grep(1), cscope(1) AUTHOR
cg was written by Joshua Uziel <uzi@uzix.org>. 13 Mar 2002 CG(1)