Sponsored Content
Top Forums UNIX for Advanced & Expert Users Processing extended ascii character file names in UNIX (BASH scipts) Post 302182375 by peli on Sunday 6th of April 2008 07:41:57 AM
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.
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
Perl::Critic::Policy::InputOutput::ProhibitExplicitStdinUser Contributed Perl DocumentaPerl::Critic::Policy::InputOutput::ProhibitExplicitStdin(3)

NAME
Perl::Critic::Policy::InputOutput::ProhibitExplicitStdin - Use "<>" or "<ARGV>" or a prompting module instead of "<STDIN>". AFFILIATION
This Policy is part of the core Perl::Critic distribution. DESCRIPTION
Perl has a useful magic filehandle called *ARGV that checks the command line and if there are any arguments, opens and reads those as files. If there are no arguments, *ARGV behaves like *STDIN instead. This behavior is almost always what you want if you want to create a program that reads from "STDIN". This is often written in one of the following two equivalent forms: while (<ARGV>) { # ... do something with each input line ... } # or, equivalently: while (<>) { # ... do something with each input line ... } If you want to prompt for user input, try special purpose modules like IO::Prompt. CONFIGURATION
This Policy is not configurable except for the standard options. CAVEATS
Due to a bug in the current version of PPI (v1.119_03) and earlier, the readline operator is often misinterpreted as less-than and greater- than operators after a comma. Therefore, this policy misses important cases like my $content = join '', <STDIN>; because it interprets that line as the nonsensical statement: my $content = join '', < STDIN >; When that PPI bug is fixed, this policy should start catching those violations automatically. CREDITS
Initial development of this policy was supported by a grant from the Perl Foundation. AUTHOR
Chris Dolan <cdolan@cpan.org> COPYRIGHT
Copyright (c) 2007-2011 Chris Dolan. Many rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module perl v5.16.3 2014-06-09 Perl::Critic::Policy::InputOutput::ProhibitExplicitStdin(3)
All times are GMT -4. The time now is 05:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy