Search Results

Search: Posts Made By: cmdcmd
1,054
Posted By Don Cragun
In general what you want to do cannot be done...
In general what you want to do cannot be done without actually writing a parser that understands all of the complexities of the C language. The single line that you are looking for:...
1,589
Posted By nezabudka
Hi, maybe this will help? if [[ $(echo $str) ==...
Hi, maybe this will help?
if [[ $(echo $str) == "hello world"* ]];
1,589
Posted By Corona688
That's clever. By feeding it into a command...
That's clever. By feeding it into a command without quotes, you've flattened the whitespace.
1,295
Posted By bakunin
You are right, sed is the correct tool for...
You are right, sed is the correct tool for virtually absolutely everything, including what you want to do. ;-))

Here is the naive approach, which will work on your example:

sed 's/\/\*.*\*\///'...
1,295
Posted By vgersh99
something to start with and improve: sed...
something to start with and improve:
sed 's#/\*.*\*/##g' myFIle
2,685
Posted By Don Cragun
Note that [[ "$line" == "{"* ]] will match lines...
Note that [[ "$line" == "{"* ]] will match lines starting with {; not lines ending with { unless the only character on the line is {.
4,881
Posted By RudiC
The pipeline | is for conveying one process'...
The pipeline | is for conveying one process' stdout to another process' stdin. Neither does mkdir print anything to stdout, nor does echo read from stdin. So - above pipe is pointless. Trymkdir -p...
4,015
Posted By Don Cragun
Hi cmdcmd, Please be a little more verbose on...
Hi cmdcmd,
Please be a little more verbose on what you are trying to do.

Are you trying to find the definition of the function named A in you C source file? If so, does it need to include the...
4,015
Posted By RudiC
I think the request was "How to grep this...
I think the request was "How to grep this function?", i.e. function A. So a small adaption of nezabudka's fine script might be suited for this:





awk '
/function *A/ {print
...
4,015
Posted By nezabudka
awk ' /function/ { print ...
awk '
/function/ { print
i++
if ( $0 !~ "{") {
getline
print
}
next...
5,405
Posted By Don Cragun
If the output you're trying to get is: I like...
If the output you're trying to get is:
I like apple
then using grep -q is never going to work for you. You'd want something more like:
grep -v ';$' filename
to do that. If you don't want grep...
Showing results 1 to 11 of 11

 
All times are GMT -4. The time now is 10:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy