Search Results

Search: Posts Made By: jaysunn
2,618
Posted By shamrock
Give this perl script a try... ...
Give this perl script a try...

#!/usr/bin/perl

use Time::Local;

while (<>) {
@f = split /\|/, $_;

($y1, $o1, $d1) = (substr($f[3], 0, 4), substr($f[3], 5, 2), substr($f[3], 8,...
1,852
Posted By RudiC
With recent shells with brace expansion:var=7-15 ...
With recent shells with brace expansion:var=7-15
eval echo {${var/-/..}}
7 8 9 10 11 12 13 14 15
The usual caveats for using eval apply.
1,864
Posted By Scrutinizer
Good to hear :) 1. newvar=$(printf "%e\n"...
Good to hear :)

1.
newvar=$(printf "%e\n" "$(bc -l <<< "${EV/[eE]/*10^}*${DV/[eE]/*10^}" )")

2.
$ printf "%e\n" "$(bc -l <<< "${EV/[eE]/*10^}*${DV/[eE]/*10^}" )"
5.000000e-04
$ printf...
2,505
Posted By Chubler_XL
How about this: IPS="10.66.1.133 ...
How about this:

IPS="10.66.1.133 10.66.6.133 10.66.7.133 10.66.0.133
10.66.1.5 10.66.2.133 10.66.4.133 10.66.3.133
10.66.5.133 10.66.2.5 10.66.3.5 10.66.7.5
...
1,511
Posted By MadeInGermany
Write that as multi-liner, and it is visibly easy...
Write that as multi-liner, and it is visibly easy to extend
sed '
s/WEND/W_END/
s/CLOSE/C_LOSE/
' f.txt
1,511
Posted By Scrutinizer
Yes definitely it reads the file only once.
Yes definitely it reads the file only once.
1,115
Posted By RudiC
Run that line with the -x option set to see what...
Run that line with the -x option set to see what causes the trouble. It may be sufficient to escape the $ signs.
1,115
Posted By MadeInGermany
Embedding the remote code in local code denotes a...
Embedding the remote code in local code denotes a second evaluation.
Instead have the script code in a separate file script.sh and run it remotely with
for server in server1 server2
do
ssh -qx -l...
Forum: What is on Your Mind? 08-26-2013
5,457
Posted By Neo
Restricting RSS feeds has shown to be counter...
Restricting RSS feeds has shown to be counter productive to our search engine rankings and directly (negatively) impacted traffic.

Therefore, effective immediately, I have removed the RSS...
3,436
Posted By Chubler_XL
Rather than matching whole line why no just match...
Rather than matching whole line why no just match on the "snmpd stop" string:

sed -i '/snmpd stop/d' /var/spool/cron/root
1,636
Posted By Corona688
tr and sed have no concept of 'column', and...
tr and sed have no concept of 'column', and trying to brute-force a regex that does can be confusing.

awk supports columns directly.

awk -F"|" -v OFS="|" '{ for(N=1; N<=NF; N++) if($N == "@")...
4,712
Posted By Corona688
Never overwrite your originals; that's a recipe...
Never overwrite your originals; that's a recipe for disaster. One mistake and all your code is blown away.

I'd suggest renaming your '.m' files into '.pm' files instead. Create '.m' files out...
6,685
Posted By ryran
If you don't get any responses, you might be...
If you don't get any responses, you might be better off posting this at python-forum (http://www.python-forum.org/pythonforum/index.php).
2,472
Posted By yazu
Try: sed '/^command="/r file1' file2
Try:
sed '/^command="/r file1' file2
10,790
Posted By bartus11
cat file | tr "\n" " "
cat file | tr "\n" " "
4,640
Posted By panyam
Hello Jaysun, I posted a sample script to...
Hello Jaysun,

I posted a sample script to show how to increment the variable and use it in find. You might need to adopt the same technique and do the changes accordingly.

Regards
Ravi
4,640
Posted By Shell_Life
See if this works for you: #!/usr/bin/ksh ...
See if this works for you:
#!/usr/bin/ksh
typeset -i mNbr=1
while [[ ${mNbr} -le 24 ]]
do
mDirA="/mnt/raw_vendor_data/raw_${mNbr}_hist/primary/"
...
18,117
Posted By bartus11
$ for i in {2..24}; do mkdir ${i}_MAY_2011 ; done
$ for i in {2..24}; do mkdir ${i}_MAY_2011 ; done
2,183
Posted By bartus11
I think you want "Source3" in all the "tags" in...
I think you want "Source3" in all the "tags" in the last record. Try this script: #!/usr/bin/perl
open I,"$ARGV[0]";
local $/;
$_=<I>;
$/="\n";
chomp $_;
@x=split /\n\n/,$_;
$x[$#x+1]=$x[$#x];...
14,147
Posted By pludi
What kind of data is this? Many small files, many...
What kind of data is this? Many small files, many large ones, or mixed? If it's many small files, it will take longer as rsync has to build an index of all files in both directories.

Generally,...
6,686
Posted By fpmurphy
OK, fired up my old RHEL5.3 harddisk and had a...
OK, fired up my old RHEL5.3 harddisk and had a look for hard links. The following hard links exists in /usr/bin

-rwxr-xr-x 2 root root 20044 Jan 5 2009 iconvconfig
-rwxr-xr-x 2 root...
6,686
Posted By Corona688
Hard links are harder to spot since they don't...
Hard links are harder to spot since they don't tell you where they all are.

One use I've abused hard links for is renaming a file that's being written to. Since the file still exists through all...
6,686
Posted By methyl
Interesting. Obviously a bad example for that...
Interesting. Obviously a bad example for that strain of Linux, but still a valid example for mainstream unix.
In unix when the links count for a file is greater than value 1 this signifies a hard...
6,686
Posted By methyl
Common example is the "ls" command. First...
Common example is the "ls" command.

First find the inode <number> of the ls command.

ls -lisad /usr/bin/ls

The inode number is in the first column.


Then use "find" to find every file...
6,686
Posted By pludi
Basically, a soft link is a special kind of file...
Basically, a soft link is a special kind of file that points to a different file somewhere on the available (mounted) filesystems. A hard link is a regular file entry in a directory, only that it...
Showing results 1 to 25 of 33

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