Search Results

Search: Posts Made By: carloszhang
3,724
Posted By carloszhang
Negation in Bash Globbing
$ ls -1
a.1
b.1
x_a.1
x_b.1

$ ls -1 [^a]*
b.1
x_a.1
x_b.1

$ ls -1 *[^a]*
a.1
b.1
x_a.1
x_b.1The last result is not as expected.
Why?
Thanks.
2,142
Posted By carloszhang
$ /bin/sh -c tmp.sh 3.2.25(1)-releaseI also...
$ /bin/sh -c tmp.sh
3.2.25(1)-releaseI also found another way to solve the issue.
$cmd="/tools/bin/bash -c 'tmp.sh a b c'";
system($cmd);
2,142
Posted By carloszhang
Shell directive not working
$ cat tmp.sh
#!/tools/bin/bash
echo $BASH_VERSION
$ cat tmp.pl
#!/usr/local/bin/perl
use strict;
use warnings;
use DBI;
use CGI;

system("tmp.sh");$ tmp.sh
3.2.48(1)-release
The result is...
14,968
Posted By carloszhang
Hi rajamadhavan, Actually it's a command output...
Hi rajamadhavan,
Actually it's a command output instead of a file,
so your above code seems not applicable.
Thanks.

---------- Post updated at 02:50 PM ---------- Previous update was at 02:45...
14,968
Posted By carloszhang
Hi rajamadhavan, thanks for the reply. I had...
Hi rajamadhavan, thanks for the reply.
I had seen the page before posting,
but below did not work. :(
$ cat a.txt
1
2
3
4
5
6
7
$ sed 3q -e :a -e '$q;N;4,$D;ba' a.txt...
14,968
Posted By carloszhang
Use sed to print first n lines and last n lines of an output.
Use sed to print first n lines and last n lines of an output.
For example: n=10
Can it be done?
Thanks.
2,022
Posted By carloszhang
$ perl -e...
$ perl -e '@f=("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","1","911"); print join("\t",@f)."\n";' | od -c
0000000 a ...
2,022
Posted By carloszhang
[~]$ perl -e...
[~]$ perl -e '@f=("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","1","911"); print join("\t",@f)."\n";'...
2,022
Posted By carloszhang
Problem of Perl's "join" function
$ perl -e '@f=("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","1","911"); print join("\t",@f)."\n";'...
6,518
Posted By carloszhang
Understood and thanks. But how do I make zgrep...
Understood and thanks.
But how do I make zgrep call unzip instead of gzip?
6,518
Posted By carloszhang
zgrep cannot find all matches
$ cat 1.csv
abc in csv
$ cat 1.mnf
abc in mnf
$ zip 1.zip 1.csv 1.mnf
adding: 1.csv (stored 0%)
adding: 1.mnf (stored 0%)
$ zgrep abc 1.zip
abc in csv

How come zgrep cannot find "abc...
5,514
Posted By carloszhang
awk to compare hex number
$ awk 'BEGIN{ pat111=0x1000000002E3E02; snBegin=0x1000000002E3E01; if (pat111<=snBegin) printf "a\n"}'
a


Result is not correct.
Looks like the number is too big.
Any idea?
Thx!


Please...
11,722
Posted By carloszhang
awk to remove leading zeros for a hex number
Is it possible by using awk to remove leading zeros for a hex number?

ex:
0000000011179E0A -> 11179E0A

Thank you!
18,518
Posted By carloszhang
It works! Thanks a lot!
It works! Thanks a lot!
18,518
Posted By carloszhang
How to auto find a string when using less command?
I want to "less" a file and go to first occurrence of a string in one command.
Is it possible?
Thanks!
1,956
Posted By carloszhang
This is exactly what I want. Thank you guys!
This is exactly what I want.
Thank you guys!
1,956
Posted By carloszhang
sorry, I want to let "find" command to read the...
sorry,
I want to let "find" command to read the namefile and find the filenames in it.
1,956
Posted By carloszhang
How to find 100 files?
Hi all,
I want to create a file containing all 100 file names.
How do I pass this namefile to find command?
Thanks!
Showing results 1 to 18 of 18

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