Search Results

Search: Posts Made By: anand_bh
1,783
Posted By anand_bh
Thanks Ravinder for the reply. Sorry for not...
Thanks Ravinder for the reply.
Sorry for not following the code rule.

I will read the man page and update the result here if I found any.
1,783
Posted By anand_bh
Sed: how to use file contents in replacement string
I want to replace a string by contents of file.

I am trying the following sed command:
cat sample | sed "s^<enter description here>^`cat details`^"

But it is not working.
a=`cat details` and...
4,659
Posted By anand_bh
Thanks for the reply. UTF-8 has 3 bytes header...
Thanks for the reply. UTF-8 has 3 bytes header before actual data.

anandb ~ $ od -c file-in-UTF-8-format.txt
0000000 357 273 277 U T F - 8 f o r m a t
0000017

I gave...
4,659
Posted By anand_bh
Output encoding in copy with ant is not working
Not sure whether I can post 'ant' related question here.
There is a requirement to convert files to UTF-8 format.

So, I tried this simple ant script.


<project name="try_copy" basedir="."...
1,440
Posted By anand_bh
grep -c word filename
grep -c word filename
2,740
Posted By anand_bh
First try only grep command and see if it works....
First try only grep command and see if it works. If yes, then pipe it to cut command.
Also run 'which grep' to make sure you are running correct version of grep.
4
1,733
Posted By anand_bh
Another way: grep -v -e pattern_1 -e...
Another way:

grep -v -e pattern_1 -e pattern_2 -e pattern_3

Here we invoke grep only once; and this is what you want.
4,533
Posted By anand_bh
Have you tried using cut ?
Have you tried using cut ?
972
Posted By anand_bh
Instead of $D=`command`, use D=`command`.
Instead of $D=`command`, use D=`command`.
2,164
Posted By anand_bh
Use if [ -d dir ] then echo dir...
Use

if [ -d dir ]
then
echo dir exists now copy
fi
9,914
Posted By anand_bh
echo appends to a read-only file
echo command can append to a read-only file too.

If the file is read-only, with w flag removed, then even echo should not be able to append to the file. But it is possible.

Can anybody explain...
2,456
Posted By anand_bh
Printing between 2 matches with Perl
Can we please modify this perl one-liner to print lines between pattern1 and pattern2 in a file?

Currently it prints lines till pattern2.
2,945
Posted By anand_bh
cat file | sed "s:'TBCD::g"
cat file | sed "s:'TBCD::g"
4,293
Posted By anand_bh
Need help with awk tool - finding text between two patterns
This is regarding using awk tool to find lines matching between 2 patterns.

cat file | awk '/pat1/,/pat2/'


But it's not working as expected in the following case.

[1]

If pat1 also...
7,450
Posted By anand_bh
This one-line command will do: sed -n...
This one-line command will do:

sed -n 100,200p filename | grep -10 pattern

searches for a pattern from line 100 to line 200 of filename and prints 10 lines above and 10 lines below the pattern.
27,728
Posted By anand_bh
You have $(warning text) function in gmake. ...
You have $(warning text) function in gmake.

$(warning This is a warning)

prints

This is a warning

to stderr.

You can have this anywhere, no condition of tab.
1,649
Posted By anand_bh
You need to use eval command.
You need to use eval command.
18,807
Posted By anand_bh
Use tr
cat filename | tr -s ' '

This should work. Replaces two or more more spaces with one space.
45,099
Posted By anand_bh
command does not return exit status due to tee
Hi,

I am using /bin/sh. I want to display the stdout and stderr on the terminal as well as save it in a file, so I'm using this command.

gmake all 2>&1 | tee log

But even if gmake fails,...
1,925
Posted By anand_bh
Try this
ls -l | grep -v '\.sh$'
Showing results 1 to 20 of 20

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