Search Results

Search: Posts Made By: carloszhang
3,789
Posted By RudiC
What RavinderSingh says is correct for regexes,...
What RavinderSingh says is correct for regexes, but not for shell globbing. * itself is the wildcard character, matching any sequence of any chars.

So - *[^a]* will match anything followed by a...
3,789
Posted By RavinderSingh13
Hello carloszhang, While using * the...
Hello carloszhang,

While using * the preceding item will be matched zero or more times. Here you haven't mentioend any thing in last expressions so it is taking everything as a match. Also * to...
2,187
Posted By Chubler_XL
So try: $ cat tmp.pl #!/usr/local/bin/perl...
So try:

$ cat tmp.pl
#!/usr/local/bin/perl
use strict;
use warnings;
use DBI;
use CGI;

system("tmp.sh", "");
15,097
Posted By rveri
carloszhang, Check it out : First n line and...
carloszhang,

Check it out : First n line and last n lines :

n=3;f=file;(head -n $n $f;tail -n $n $f)

with Classic ed:
n=3;printf "1,${n}p\n\$-${n}+,\$p\nq\n"|ed -s file
15,097
Posted By Jotne
Just for the fun of it, using awk awk...
Just for the fun of it, using awk
awk '{a[NR]=$0} NR<=n {print} END{for (i=NR-n+1;i<=NR;i++) print a[i]}' n=3 file
This prints the first 3 and last 3 records of file

Or if you like it to the...
15,097
Posted By Don Cragun
I know that you asked for a sed solution, but ed...
I know that you asked for a sed solution, but ed is well suited to something like this and only needs to be invoked once to do it. This was tested using a Korn shell, but will work with any shell...
15,097
Posted By rajamadhavan
Is your need to print them at one go using a...
Is your need to print them at one go using a single sed command ?

Can't you go with something like this ?


sed '3q' filename && sed -e :a -e '$q;N;4,$D;ba' filename
15,097
Posted By rajamadhavan
Check "selective printing of certain lines"...
Check "selective printing of certain lines" section on this page

http://www.catonmat.net/blog/wp-content/uploads/2008/09/sed1line.txt
2,048
Posted By itkamaraj
od -c after your perl command. perl -e...
od -c after your perl command. perl -e blah...blah... | od -c
2,048
Posted By radoulov
I cannot reproduce this behavior: bash-2.03$...
I cannot reproduce this behavior:

bash-2.03$ perl -e '@f=("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","1","911");...
6,567
Posted By drl
Hi. On my system: OS, ker|rel, machine:...
Hi.

On my system:
OS, ker|rel, machine: Linux, 2.6.26-2-amd64, x86_64
Distribution : Debian GNU/Linux 5.0.8 (lenny)


The command zgrep is a shell script:
% file /bin/zgrep...
6,567
Posted By pamu
check this out.....
this very strange i don't what is reason for this....


zcat 1.zip
abc in csv
zcat: 1.zip has more than one entry--rest ignored
$
5,549
Posted By radoulov
I believe this is an implementation limit, not a...
I believe this is an implementation limit, not a bug, i.e. these numbers are large for awk.

You may use Perl though:


perl -le'
$pat111 = 0x1000000002E3E02;
$snBegin = ...
5,549
Posted By rdcwayx
Looks like a bug in awk awk 'BEGIN{...
Looks like a bug in awk
awk 'BEGIN{ pat111=sprintf ("%d", 0x1000000002E3E02); snBegin=sprintf("%d",0x1000000002E3E01);print pat111;print snBegin; if (pat111<=snBegin) printf "a\n"}'
...
11,814
Posted By tene
echo "0000000011179E0A" | sed 's/^0*//'
echo "0000000011179E0A" | sed 's/^0*//'
11,814
Posted By Chubler_XL
Convert to base 10 using bash/ksh base conversion...
Convert to base 10 using bash/ksh base conversion and back to hex with printf:

$ printf "%X" $((16#0000000011179E0A))
11179E0A

Edit: Beware - After more testing of the above I found it...
11,814
Posted By kurumi
$ echo 0000000011179E0A | ruby -e 'print...
$ echo 0000000011179E0A | ruby -e 'print gets.sub(/^0*/,"")'
11179E0A
11,814
Posted By mirni
$ echo 0000000011179E0A | awk '{print...
$ echo 0000000011179E0A | awk '{print gensub(/^0*/,"","")}'
11179E0A
18,559
Posted By Ygor
From Man Page for less (Linux Section 1) - The...
From Man Page for less (Linux Section 1) - The UNIX and Linux Forums (https://www.unix.com/man-page/Linux/1/less/)
1,974
Posted By vbe
Greetings Franklin! I understand now, that what...
Greetings Franklin!
I understand now, that what is wanted is feeding find command with the names supplied from a file:
So its going to use a loop...
e.g.

cat filename | while read FILETOFIND...
1,974
Posted By Franklin52
Try something like this, but I'm not shure if...
Try something like this, but I'm not shure if this is what you're looking for:
find <your options> | grep -f namefile
104,804
Posted By tmarikle
By the way, your specific issue is that you do...
By the way, your specific issue is that you do not have quotes around your variable:


echo "$list" # now see what happens...
Showing results 1 to 22 of 22

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