Search Results

Search: Posts Made By: franzpizzo
8,742
Posted By franzpizzo
The problem are the chars ‘ ’ – that are similar...
The problem are the chars ‘ ’ – that are similar but different: the probelm occurs when copy and paste code in msoffice:

find /usr/IBM/HTTPServer/apache_cache -name \* -mtime +1 -exec rm {} \;
5,427
Posted By franzpizzo
I hope this will be useful for you: awk...
I hope this will be useful for you:

awk -F'=' '{printf "%s=_%s_\n",$1,toupper($1)}' file_to_convert.txt
10,160
Posted By franzpizzo
The redirect to the standard is echo "Error"...
The redirect to the standard is

echo "Error" 1>&2

so

#!/bin/bash
if [ $# -lt 1 ] ; then #Check there is enough command line parameters.
echo "Not enough command line parameters" 1>&2...
2,496
Posted By franzpizzo
I'm not sure that it works :-) ssh A 'ssh...
I'm not sure that it works :-)


ssh A 'ssh B awk 'BEGIN{printf "select * from testing where name =%ctest%c\n",39,39;}' '
1,287
Posted By franzpizzo
Hi, if you want only the records with...
Hi, if you want only the records with my_expr_tmstp in the previous day change the script in this way:

select my_id, my_expr_tmstp from MY_SCHEMA.MY_TABLE
where my_expr_tmstp =...
4,902
Posted By franzpizzo
I've found this: cat a.pl ...
I've found this:


cat a.pl

#!/bin/perl
system('./b.pl 1');
$return=$? >> 8 ;
print $return;



cat b.pl

#!/bin/perl
print "file b: $ARGV[0] \n";
exit 100;
4,902
Posted By franzpizzo
Hi, the problem seems to be the presence of the...
Hi, the problem seems to be the presence of the return command in b.pl file: you may use return only in a function. Replace it with exit.
9,107
Posted By franzpizzo
Hi, is this what you need? ...
Hi, is this what you need?

X=STRING_TO_SEARCH
cat file.txt |sed "s/$X/\n$X\n/g"|grep -c "$X"
5,706
Posted By franzpizzo
Hi, try this X=20130422 Y=$(echo $X|cut...
Hi, try this

X=20130422
Y=$(echo $X|cut -c1-4)
M=$(echo $X|cut -c5-6)
D=$(echo $X|cut -c7-8)
Y1=$(( Y - 1 ))
if [[ $M -eq 2 ]] && [[ $D -eq 29 ]]
then
D=28
fi
echo ${Y1}${M}${D}
2,069
Posted By franzpizzo
Hi, question is that sqlplus return an errorcode...
Hi, question is that sqlplus return an errorcode only if there are a connection issue, else in every case return 0.
A simple solution is to redirect the output to a tmp file and check the content:
...
3,194
Posted By franzpizzo
Try this: cat matrix.txt A B C D A...
Try this:


cat matrix.txt
A B C D
A 0.00 0.06 0.51 0.03
B 0.06 0.00 0.72 0.48
C 0.51 0.72 0.00 0.01
D 0.03 0.48 0.01 0.00


cat matrix.txt| awk -F" "...
3,704
Posted By franzpizzo
It is not nice but it works printf...
It is not nice but it works


printf "mysample%d\n" $( ls -1 mysample*|sed 's/mysample//'| sort -n )
1,456
Posted By franzpizzo
Hi, the ls command sort alphabetically by...
Hi, the ls command sort alphabetically by default, then

ls -1

or

ls -1r

for revert order
1,683
Posted By franzpizzo
Hi this code set the value in the file or...
Hi
this code set the value in the file or replace an existing assignment

VAR=COL2
VAL=1
sed -i "s/^${VAR}=.*/${VAR}=${VAL}/" test.txt
1,069
Posted By franzpizzo
Hi try to add this awk: cat textfile.txt...
Hi
try to add this awk:

cat textfile.txt |cut -d: -f4 |awk '{ printf "%s\n%s\n",substr($1,1,16),substr($1,17);}'>textfile2.txt


In a single command:

awk -F: '{ printf...
43,071
Posted By franzpizzo
Hi, this is a a similar solution of matrixmadhan:...
Hi, this is a a similar solution of matrixmadhan:

cat spool.txt

X Y Z
---------- ---------- ----------
1 2 3
1 2 ...
1,266
Posted By franzpizzo
Hi I suppose you're using an interactive bash...
Hi
I suppose you're using an interactive bash shell, and you have modified the .bashrc, can you try to disconnect and reconnect to the Unix environment?
43,228
Posted By franzpizzo
Hi in ksh you can do in this way ...
Hi
in ksh you can do in this way

#!/bin/ksh
calc()
{
A=$1
B=$2
total=$(( A + B ))
diff=$(( A - B ))
echo "$total $diff"
}
RES=$( calc 5 8 )
TOT=$( echo $RES | cut -f 1 )...
1,597
Posted By franzpizzo
@Corona688 it's fantastic: DAY=$1 ...
@Corona688 it's fantastic:

DAY=$1
MONTH_MONDAY_YEAR="1 2 3 4"
STR="MONTH_${DAY}_YEAR"
for i in ${!STR}
do
echo ${i}
done
1,597
Posted By franzpizzo
Thanks to PikK45: then I suggest this code ...
Thanks to PikK45: then I suggest this code

DAY=$1
MONTH_MONDAY_YEAR="1 2 3 4"
eval echo \$MONTH_${DAY}_YEAR |tr -s ' ' '\n'| while read i
do
echo ${i}
done
1,597
Posted By franzpizzo
Hi, there are some errors 1) assegments without...
Hi, there are some errors
1) assegments without spaces

MONTH_MONDAY_YEAR=1 2 3 4

2) this sintax is not possible
${MONTH_${DAY}_YEAR}
But the question is: what is the expected result?
4,222
Posted By franzpizzo
Add this code before the copy: if [[ "$file"...
Add this code before the copy:

if [[ "$file" =~ \ |\' ]]
then
exit -15
fi
7,692
Posted By franzpizzo
The command find . ! -name . -prune -name...
The command

find . ! -name . -prune -name $FILE -mtime +2

search in the current directory (the first parameter "." ) and not in the subdir (the second block of parameters "! -name . -prune") a...
7,692
Posted By franzpizzo
@vipin kumar You're saying that ...
@vipin kumar
You're saying that



FILE=mynewfile.txt
touch $FILE
if [[ ! -f $FILE ]]
then
echo $FILE not exists
else
N=$(find . ! -name . -prune -name $FILE -mtime +2|wc -l)
if [[ $N...
7,692
Posted By franzpizzo
@vipin kumar use stat command in this way: ...
@vipin kumar
use stat command in this way:

stat -c %Z test.txt

and read this

man stat


---------- Post updated at 11:42 AM ---------- Previous update was at 11:17 AM ----------
...
Showing results 1 to 25 of 67

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