Processing extended ascii character file names in UNIX (BASH scipts)


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Processing extended ascii character file names in UNIX (BASH scipts)
# 8  
Old 04-06-2008
Hi again, I don't know if I can continue this topic but I have futher related problems with my Installer.

I have shared files that's not included in the Mac or Win installers. The installers get this files from a script and install them in the right location. There's accentuated characters in the folder names. This time it's an "ä" and the ASCII code is I belive 303 244. So I put in \0303\0244 in the text but there's more to it and I need help with that?

The script for OS X goes as follow:

Code:
#!/usr/bin/perl
#open EFILE, ">>$ENV{HOME}/Desktop/postDocuOutfile.txt";
#print EFILE "ARGV 0 = $ARGV[0]\n";
#print EFILE "ARGV 1 = $ARGV[1]\n";
#print EFILE "ARGV 2 = $ARGV[2]\n";
#print EFILE "ARGV 3 = $ARGV[3]\n";
#print EFILE "ARGV 4 = $ARGV[4]\n";

#$1: The full path to the installation package.
#$2: The full path to the installation destination.
#$3: The mountpoint of the destination volume.
#$4: The root directory for the current System folder.

$thisDir = $ARGV[0];
#print "*********thisDir = $thisDir\n";

chomp $thisDir;
@thisDirElements = split '/', $thisDir;

#close EFILE;

if ( $thisDirElements[1] eq 'Volumes' ) #do I need this anymore????
{
#	print "*********Inside IF thisDirElements[1] eq Volumes"
	$tutorialInstallPath = '/'.$thisDirElements[1].'/'.$thisDirElements[2].'/FINDATA/Sj\0303\0244lvstudier/Lektion6b.mov';
	if (! -e $tutorialInstallPath )
	{
		$tutorialInstallPath = '/'.$thisDirElements[1].'/'.$thisDirElements[2].'/fsCommand/FINDATA/Sj\0303\0244lvstudier/Lektion6b.mov';
		
	}
#	print "*********Tutorial Install Source = $tutorialInstallPath\n";
	$qsvInstallPath = '/'.$thisDirElements[1].'/'.$thisDirElements[2].'/FINDATA/Videotips';
#	print "*********QSV Install Source = $qsvInstallPath\n";
	`cp -f -p "$tutorialInstallPath" "/Applications/Finale 2008/Sj\0303\0244lvstudier"`;
	`cp -R -f -p "$qsvInstallPath" "/Applications/Finale 2008/Hj\0303\0244lpfiler"`;
}
#close EFILE;
exit 0;


On the CD is a folder "in the same directory as the Installer" called "FINDATA" and in that to folders "Självstudier and Hjälpfiler". In "Självstudier" is placed a movie "Lektion6b.mov" that the installer will get and the folder called "Hjälpfiler".

Thank's

peli

Last edited by Don Cragun; 02-21-2016 at 03:27 PM.. Reason: Change SIZE and I flags to CODE tags.
# 9  
Old 04-06-2008
You have to use double quotes (instead of single ones) and specify only three digits for the octal code. In this manner you can also avoid the concatenation operator, for example:

Code:
$tutorialInstallPath = "/$thisDirElements[1]/$thisDirElements[2]/FINDATA/Sj\303\244lvstudier/Lektion6b.mov";

# 10  
Old 04-06-2008
Thank's

God enough for Rock'n Roll

peli
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Print byte position of extended ascii character

Hello, I am on AIX. When I encounter extended ascii characters and special characters on a file I need to print.. Byte position, actual character and line number. Is there a simple command that can give me the above result ? Thanks in advance (38 Replies)
Discussion started by: rosebud123
38 Replies

2. UNIX for Beginners Questions & Answers

Convert ascii character values to number that comes between the numbers in UNIX

I have variable that contains multiple values of number and also include overpunch(i.e. # $ % etc) character so we want to replace it with numbers. here are the example: Code: 11500#.0# 28575$.5$ 527#.7# 42".2" 2794 .4 2279!.9! 1067&.7& 926#.6# 2279!.9! 885".5" 11714$.4$ 27361'.1'... (1 Reply)
Discussion started by: nadeemrafikhan
1 Replies

3. Shell Programming and Scripting

Removal Extended ASCII using awk

Hi All, I am trying to remove (SELECTIVE - passed as argument) Extended ASCII using Awk based on adhoc basis. Can you please let me know how to do it. I have to implement this using awk only. Thanks & Regads (14 Replies)
Discussion started by: tostay2003
14 Replies

4. Shell Programming and Scripting

Identify extended ascii characters in a file

Hi, Is there a way to identify the lines in a file having extended ascii characters and display the same? For instance I have a file abc.txt having below data aaa|bbb|111|This is first line aaa|bbb|222|This is secõnd line aaa|bbb|333|This is third line aaa|bbb|444|This is foùrth line... (3 Replies)
Discussion started by: decci_7
3 Replies

5. Shell Programming and Scripting

Preserve extented ascii character when run echo comand inside bash script

Hi everyone, I'm echo some text with extended ascii characters as below: echo -e "Pr\xE9sentation du spectacle" > output or echo -e "Présentation du spectacle" > outputIf I open the file created I see this text Présentation du spectacleThe text is shown correctly in this created file when... (7 Replies)
Discussion started by: Ophiuchus
7 Replies

6. AIX

Printing extended ASCII

Hi All, I'm trying to send extended ascii characters to my HP2055 as part of PCL printer control codes. What I want to do is select a bar code font, print the bar code and reset the printer to the default font. Selecting the bar code font works good. Printing the bar code goes almost ok too. ... (5 Replies)
Discussion started by: petervg
5 Replies

7. Shell Programming and Scripting

read in a file character by character - replace any unknown ASCII characters with spa

Can someone help me to write a script / command to read in a file, character by character, replace any unknown ASCII characters with space. then write out the file to a new filename/ Thanks! (1 Reply)
Discussion started by: raghav525
1 Replies

8. Shell Programming and Scripting

extended ascii problem

hi i would like to check text files if they contain extended ascii characters within or not. i really dont have any idea how to start your kind help would be very much appreciated thanks. (7 Replies)
Discussion started by: smooth
7 Replies

9. Shell Programming and Scripting

Weird Ascii characters in file names

Hi. I have files in my OS that has weird file names with not-conventional ascii characters. I would like to run them but I can't refer them. I know the ascii # of the problematic characters. I can't change their name since it belongs to a 3rd party program... but I want to run it. is there... (2 Replies)
Discussion started by: yamsin789
2 Replies

10. Programming

Extended ascii

Hi all, I would like to change the extended ascii code ( 128 - 255). I tried to change LC_ALL and LANG in current session ( values from locale -a) and for no good. Thanks. (0 Replies)
Discussion started by: avis
0 Replies
Login or Register to Ask a Question