Search Results

Search: Posts Made By: nrjrasaxena
2,291
Posted By Lem
if [ -s $FILE ] && (( $(stat -c %s $FILE) >...
if [ -s $FILE ] && (( $(stat -c %s $FILE) > 104857600 )); then
--
Bye
2,086
Posted By Corona688
So put more error-checking in your code. Check...
So put more error-checking in your code. Check for the presence of certain files. If they're not there,complain that such-and-such variable hasn't been set and quit.

#!/bin/bash

die() {
...
3,006
Posted By Corona688
SAMPLE is global, $1 is not. When you call a...
SAMPLE is global, $1 is not. When you call a function it gets its own $1 $2 ... variables.

Try this.

#!/bin/sh

function asdf() {
echo "asdf's 1 is $1"
echo "asdf's 2 is...
3,006
Posted By pamu
Not sure what could be the issue.. try...
Not sure what could be the issue..

try this...


SAMPLE=$2
#ForMakingPU ...
3,006
Posted By Corona688
replace 'root -L' with 'cat' to see if your...
replace 'root -L' with 'cat' to see if your program ends up as exactly what you want once you leave the here-document.
2,287
Posted By tukuyomi
Which shell are you using? In sh, dash,...
Which shell are you using?

In sh, dash, should run on bash as well:
#!/bin/sh

if [ ! "$1" ]; then
TEXT="Data_0"
else
TEXT="$1"
fi

if [ ! "$2" ]; then
Lines=45
else
Lines=$2
fi
2,287
Posted By delugeag
$# return the number of argument.
$# return the number of argument.
53,864
Posted By pamu
Ok.. Then use PATHNAME as array only.. ...
Ok..

Then use PATHNAME as array only..


PATHNAME[1]=${PATH525[1]}
PATHNAME[2]=${PATH525[2]}


How to use array you know that..

If it has one element also make it is as first entry..

...
53,864
Posted By bakunin
That is to be expected. You have defined not...
That is to be expected. You have defined not variables but arrays. In fact you have defined arrays with only one member, which is kind of contradicting the purpose of an array.

Array variables are...
53,864
Posted By bakunin
Always keep in mind that the shell "expands"...
Always keep in mind that the shell "expands" variables before evaluating a line. That means that an expression like "$var" will be replaced by the contents of this variable. The default content of a...
53,864
Posted By pamu
"" will be useful if your variable having...
"" will be useful if your variable having space...

My above given code works perfect for your file list..


echo "data1.list
data2.list
data3.list" | sed 's/data[a-zA-Z0-9]*/data1/g'...
53,864
Posted By pamu
Opps... Sorry i've done mistake there..:D ...
Opps...

Sorry i've done mistake there..:D

Try this....



sed 's/adds[a-zA-Z0-9]/data1/g'
3,420
Posted By delugeag
find can do the same thing with printf ...
find can do the same thing with printf

-printf "%T@ %f\n"
3,420
Posted By 244an
I still haven't studied your script in details,...
I still haven't studied your script in details, and don't understand what you mean with "hard time in that CP command", but there is one more thing I noticed:
...
SubmitBatchJob () {
max=$2...
53,864
Posted By bakunin
Just an observation: much of the confusion...
Just an observation:

much of the confusion is caused by using "i" or "j" instead of meaningful variable names. If a variable is an index to a filename, then call it "FileNameIdx" or something...
53,864
Posted By pamu
1) What you can do here is ... Just create an...
1) What you can do here is ...
Just create an array ( i don't know how is your directory structure, from your post it look like there is no pattern so we can get those path).
just give paths in a...
53,864
Posted By elixir_sinari
Hey, sorry for that. I'd made a typo in my post...
Hey, sorry for that. I'd made a typo in my post (rectified now). It ought to be typeset and not typset
4,877
Posted By Corona688
Fixed that for you. Not all Bourne shells...
Fixed that for you.

Not all Bourne shells are BASH. BASH is a Bourne shell, with extended features that a generic Bourne shell doesn't have -- like arrays, and functions.

There is also more...
4,507
Posted By methyl
Leave a space character after if (or any unix...
Leave a space character after if (or any unix command for that matter).
4,507
Posted By RudiC
pls leave spaces around [ and ]. @Corona668:...
pls leave spaces around [ and ].
@Corona668: the [ needs a leading space as well.
4,507
Posted By Corona688
This is wrong, you're missing a space: if[...
This is wrong, you're missing a space:
if[ $i == 1] ;
if[ $i == 1 ]

The semicolon on the end was also pointless, but harmless too. ; separates multiple commands on a line, you don't...
1,729
Posted By ahamed101
Try this... #!/bin/bash TEXT=$1 LINES=$2...
Try this...

#!/bin/bash
TEXT=$1
LINES=$2
FINAL=$3

awk '{if($0~text){p=lines;next}}
{if(filename!=FILENAME){f[++g]=FILENAME;filename=FILENAME}}
p>0{
split($0,arr,"=")
...
1,979
Posted By ahamed101
Try this... awk '/using photon...
Try this...

awk '/using photon counter/{p=12;next}
p>0{
split($0,arr,"=")
h[$1"HDR"]=arr[1]
a[$1]=a[$1]" "$NF
sum[$1]+=$NF
p--
}
END{
for(i...
Showing results 1 to 23 of 23

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