![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ssh script problem problem | pcjandyala | Shell Programming and Scripting | 2 | 07-31-2008 12:27 PM |
| Problem With script | FLABITS | Shell Programming and Scripting | 3 | 03-30-2008 09:34 AM |
| Problem in Script ! | varungupta | UNIX for Advanced & Expert Users | 3 | 03-22-2007 04:58 AM |
| script problem | tdavenpo | Shell Programming and Scripting | 3 | 01-04-2006 01:07 PM |
| Problem starting a script from a 'main'-script | Rakker | UNIX for Dummies Questions & Answers | 3 | 06-28-2005 05:12 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Script problem
Hi, I need help with a script.
I posted a thread about this earlier this year with the title "Processing extended ascii character file names in UNIX (BASH scipts)". This script is new and is doing the same thing. It's a little bit different so I can't use the erlier one that Robotronic helped me with. It need to be altered to function. The script goes: #!/bin/bash APP_VOL=$3 echo "APP_VOL="$APP_VOL if [ "$APP_VOL" == "/" ] ; then APP_FOLDER="/Applications/Finale 2009" else APP_FOLDER="${APP_VOL}/Applications/Finale 2009" fi COMP_FOLDER="${APP_FOLDER}/Komponenfiler" cp -R -n -p "/Library/Application Support/MakeMusic/Finale 2009/Components/ensembles.txt" "${COMP_FOLDER}" cp -R -n -p "/Library/Application Support/MakeMusic/Finale 2009/Components/instrument.txt" "${COMP_FOLDER}" cp -R -n -p "/Library/Application Support/MakeMusic/Finale 2009/Components/MacSymbolFonts.txt" "${COMP_FOLDER}" cp -R -n -p "/Library/Application Support/MakeMusic/Finale 2009/Components/pagesizes.txt" "${COMP_FOLDER}" cp -R -n -p "/Library/Application Support/MakeMusic/Finale 2009/Components/Maestro Font Default" "${COMP_FOLDER}" cp -R -n -p "/Library/Application Support/MakeMusic/Finale 2009/Components/Jazz Font Default" "${COMP_FOLDER}" rm -rf "/Library/Application Support/MakeMusic/Finale 2009/Components/" I have to make the lines 6 and 7 like this in order to use the word "filförval" cp -R -n -p "/Library/Application Support/MakeMusic/Finale 2009/Components/Maestro filf\0303\0266rval" "${COMP_FOLDER}" cp -R -n -p "/Library/Application Support/MakeMusic/Finale 2009/Components/Jazz filf\0303\0266rval" "${COMP_FOLDER}" I think I need a echo command here in order to get it to work. If I use the letter "o" instead of "ö" it work alright. Can anyone help me? Robotronic? Thank's peli |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
The way the Mac encodes characters in a file name are different from the settings for your shell. The Mac uses something called "fully decomposed" Unicode which is different from the UTF-8 encoding you are using in the examples. If you can find the correct representation (perhaps with tab completion?) your script should work. Or as a workaround, simply use a wildcard to skip over the character you can't type (unsure whether "filf?rval" or "filf??rval" should work; depends again on the encoding I guess. "filf*rval" should certainly work, at least.)
Samma på svenska. |
|
#3
|
|||
|
|||
|
Thank's "era" for your answer but it's not working.
This is a working script for the line with Maestro in it: x=$(echo -e "/Library/Application Support/MakeMusic/Finale 2009/Komponenter/Maestro filf\0303\0266rval") cp -R -n -p "$x" "/Applications/Finale 2009/Komponentfiler" I can't use "${COMP_FOLDER}" to get the folder name, just the actual folder name (Komponentfiler) to make it work. peli |
|
#4
|
|||
|
|||
|
I don't think we understand each other properly. What I'm saying is try
Code:
components="/Library/Application Support/MakeMusic/Finale 2009/Components" # just to make this shorter
cp -R -n -p "$components/Maestro filf"*"rval" "${COMP_FOLDER}"
cp -R -n -p "$components/Jazz filf"*"rval" "${COMP_FOLDER}"
I know nothing about Mac filesystems so I may be out on a limb as far as the theoretical side goes, but the workaround should hopefully help at least. |
|||
| Google The UNIX and Linux Forums |