Search Results

Search: Posts Made By: sam05121988
3,960
Posted By durden_tyler
$ $ perl -le '@files = qw (file....
$
$ perl -le '@files = qw (file. file.TODAY.THISYEAR file.TODAY.LASTYEAR);
$TODAY = "140805"; $THISYEAR = "2014"; $LASTYEAR = "2013"; # should not be hard-coded
foreach $i...
3,958
Posted By PikK45
#/bin/bash while [ 0 ] do #if 0b file...
#/bin/bash
while [ 0 ]
do
#if 0b file exists
if [ -e /ntwrk/common/backup_in_progress.txt ]
then
#Record the start time
tm=`date "+%Y%m%d %H%M"`
echo "$tm" >...
3,017
Posted By bartus11
Try:awk -F"|" '$1!=a[$2]&&a[$2]{print...
Try:awk -F"|" '$1!=a[$2]&&a[$2]{print b[$2];print}{a[$2]=$1;b[$2]=$0}' file
22,644
Posted By Don Cragun
$sum=0; for i in `cat b22` do sum=`echo "$sum...
$sum=0; for i in `cat b22`
do
sum=`echo "$sum + $i" | bc`
done; echo $sum;
would have worked if you had changed $sum=0 on the first line to sum=0
I assume that the variable sum was not set when...
1,457
Posted By elixir_sinari
Will this do? awk '/[1-9][0-9]* rows affected/'...
Will this do?
awk '/[1-9][0-9]* rows affected/' RS=\= infile
6,732
Posted By Scrutinizer
This should remove empty lines with any kind of...
This should remove empty lines with any kind of whitespace..
awk NF file
21,295
Posted By Scrutinizer
Or use "continue": for i in 1 2 3 4 5 6 do ...
Or use "continue":
for i in 1 2 3 4 5 6
do
if [ $i -eq 2 ]
then
continue #jump to element 3
else
echo $i
fi
done
3,153
Posted By asterisk-ix_use
Use -1 switch of ls instead of awk ...
Use -1 switch of ls instead of awk


#!/usr/bin/perl -w
use strict;
my $count=0;
my @list=`ls -1`;
print "@list";
Forum: Programming 04-10-2012
2,107
Posted By yazu
You don't need '-n' option here.
You don't need '-n' option here.
Forum: Programming 04-10-2012
2,107
Posted By radoulov
Please post the output if the following command: ...
Please post the output if the following command:

perl -e 'printf "%s --> %d\n", $_, -s for @ARGV' sam*
4,167
Posted By DeCoTwc
Depending on what you're trying to do, this could...
Depending on what you're trying to do, this could be a good use for lock files. There's a bunch of different ways you could do it. But based on the simplicity of your example, the easiest way would...
4,167
Posted By elixir_sinari
while [ 1 ] do processes_running=`ps -fu...
while [ 1 ]
do

processes_running=`ps -fu <username>|grep -e "$JOBNAME" |grep -v grep|wc -l`
if [ $processes_running -ge 1 ]
then

<whatever you want do if jobname is running>

else
...
Showing results 1 to 12 of 12

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