Bonjour,

j'ai un probléme perturbant.
J'ai écrit un script shell qui fonctionne à merveille sur mon PC (win XP)

J'essaie de faire marcher le script sur un serveur unix, il plante à tous les coups et me sort des messages d 'erreur :
: command not foundipts/MyScript.sh: line 4:
/home/Scripts/MyScript.sh: line 10: syntax error in conditional expression
'home/Scripts/MyScript.sh: line 10: syntax error near `]]
'home/Scripts/MyScript.sh: line 10: `if [[ $# -ne 2 ]]
Voici les premières lignes de mon script
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 
#!/bin/ksh
#****************************************************************************#
#  Program Name  : obfuscation.ksh
 
# this process avoids overlapping strings: the first string replaced is the biggest (dictionary speaking) so that if a string is included in another, the comparison happens once
Ref_file=$1/Scripts/Neutralize.txt
Log_file=$1/Logs/Obfuscation.log
 
if [[ $# -ne 2 ]]
	then
		echo "Error Calling the obfuscation script" >> $Log_file
		echo "The script needs exactly 2 arguments. Usage: ./MyScript.ksh MainFolderPath FolderToObfuscatePath." >> $Log_file
		exit 255
	fi
 
if [[ -e TEMP ]]
	then
		rm -f TEMP
	fi
 
while read line
do
	count=`echo $line | cut -f1 -d "," | wc -m`
	echo "$count	$line" >> TEMP
done < $Ref_file
 
sort -r TEMP > $Ref_file
awk '{ printf( "%s" , substr( $0, 10, 100)); printf( "\n" ) } '