Search Results

Search: Posts Made By: siva shankar
3,959
Posted By siva shankar
Try this... find...
Try this...
find /Users/username/Desktop/convert/ -name "Object.obj" -type f -exec sh -c '\
sed "s!\o primary*!g primary!" {} | sed "s!\o secondary*!g secondary!" > `dirname {}`/Object2.obj; \
rm...
4,144
Posted By siva shankar
in ur snippet change as below echo $linexT |...
in ur snippet change as below
echo $linexT | sed 's/^[ \t]*//g;s/[ \t]*$//g'

if u need one liner
echo $linexT | sed 's/^[ \t]*//g;s/[ \t]*$//g;s/,$//g'

else
sed 's/^[ \t]*//g;s/[...
2,543
Posted By siva shankar
hi balajesuri, grep "^ *ALTER TABLE"...
hi balajesuri,

grep "^ *ALTER TABLE" inputfile

The above command will only search only for lines which have 0 to n spaces followed by the PATTERN and neglect if the PATTERN is after tab...
2,543
Posted By siva shankar
u can use sed and grep combination, sed...
u can use sed and grep combination,

sed 's/^[ \t]*//g;' filename | grep "^ALTER TABLE"

This will remove all tabs and spaces at starting and then match...
2,214
Posted By siva shankar
Another simple shell script awk '{ if($1...
Another simple shell script

awk '{
if($1 != "") {
if($1 == "Question:") {num=$2}
else if ($1 == "Options:") {print ""}
else {printf "%s %s", num, $0; num=""}
}
}' infile
2,543
Posted By siva shankar
Try grep "^ALTER TABLE" filename
Try

grep "^ALTER TABLE" filename
5,807
Posted By siva shankar
A small script for the same, echo "Enter...
A small script for the same,

echo "Enter date[MM/DD/YYYY]:"
read datee
day=$(date -d $datee +%u)
num=`expr 7 - $day`
x="date -d '$datee $num days'"
eval $x
num=`expr $day - 1`
x="date -d...
5,807
Posted By siva shankar
If u have -d option, u can use it date -d...
If u have -d option, u can use it
date -d '12/22/11' +'%u'
5,946
Posted By siva shankar
I think this option might help u... -n,...
I think this option might help u...

-n, --quiet, --silent
suppress automatic printing of pattern space
Forum: Programming 12-08-2011
2,776
Posted By siva shankar
Hi friend, The code is not only for...
Hi friend,

The code is not only for n=0, its in a for loop. Let me explain with an example.

If s contain a string "5270", then the loop continue for 4 times:

1st : 10*0 + 5 = 5
2nd :...
2,671
Posted By siva shankar
in ur code replace as state3=`expr $state3 -...
in ur code replace as

state3=`expr $state3 - $ct`
2,671
Posted By siva shankar
change the below line and execute... while...
change the below line and execute...

while read ct

its not $ct
18,285
Posted By siva shankar
I hope know its working fine...
I hope know its working fine...
Forum: Programming 11-08-2011
17,416
Posted By siva shankar
In your code, you are creating pipe inside loop ...
In your code, you are creating pipe inside loop
for (i = 0; i < nr_proc; i++) {
pipe (fd);
So you are losing data of previous child, try to keep it above for loop and try...
18,285
Posted By siva shankar
sed...
sed '/\/\*$/,/\*\/$/d;/\/\*[^*]/,/\*\/$/d;/\/\*.\*\/$/d;/^[ \t]*\/\//d' $FILE

This will work fine unless there is no code like
int main()
{
/*
some code
*/some code or space character
}
...
18,285
Posted By siva shankar
Try this... sed ...
Try this...
sed '/\/\*$/,/\*\//d;/\/\*[^*]/,/\*\//d;/\/\*.\*\//d;/^[ \t]*\/\//d' $FILE
Showing results 1 to 16 of 16

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