International filenames using bash
Hi
Typing umlauts in the terminal is easily done. Using ls -v one can see filenames with international characters. However how does one enable it so that scripts that are run as other users also can recognized filenames that contain international characters?
i'm havin an issue with a perl/cgi script that outputs the bulk of the content in iso-8859-1 encoding but not the filenames..any international characters in filenames come out wrong. I can change the script so that it outputs the filenames in utf-8 encoding but then the rest of the content comes out wrong.
it's possible this is an issue with perl/cgi, however i'm thinking that since my shell doesnt seem to recognize international characters by default that maybe the issue is there.
i have tried setting LC_ALL=utf-8 to no avail.
Hopefully we have some people out there with experience concerning filenames containing international characters and perhaps with suggestions on what, if any, environment variables should be set etc.
Thanks
Hi Thomas,
The syntax I've seen recommended for setting the LC_ALL environment variable was something along the lines of:
export LCALL=enUS.UTF-8
I assume that your language and local aren't English and the US but I'm sure you can change that to something more appropriate. The syntax for setting the LANG variable is the same I believe.
Gary
~~~~
A "practical joker" deserves applause for his wit according
to its quality. Bastinado is about right. For exceptional wit
one might grant keelhauling. But staking him out on an
anthill should be reserved for the very wittiest.
-- Lazarus Long
Similar Messages
-
Using bash as your file manager?
Hello,
My belief is that all file managers suck. There are no exceptions to this. So, for the past few months, I've been sourcing a file with a bunch of tricks I've invented / found through browsing the web to make using just bash as a file manager much more convenient.
Here's what I currently use:
# fm v1.9.1 by Kiah Morante
# A very simple file manager.
# Depends on pycp/pymv, http://github.com/yannicklm/pycp and feh
# 'source' this file in a BASH shell
showHidden=0 # Hidden files not shown
showDetails=0 # ls is replaced with ls -lh if showDetails is 1
shopt -s autocd # cd to a dir just by typing its name
PROMPT_COMMAND='[[ ${__new_wd:=$PWD} != $PWD ]] && list; __new_wd=$PWD' # ls after cding
# Shortcuts
source ~/.config/fm/shortcuts # Call all custom shortcuts
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias h='cd ~'
alias n='cd "$n"'
# Keybindings
bind '"\C-l":"list\C-m"'
bind '"\C-h":"hide\C-m"'
bind '"\C-o":"details\C-m"'
bind '"\C-f":"makedir\C-m"'
bind '"\C-n":"n\C-m"'
bind '"\C-y":"cpwd\C-m"'
bind '"\C-p":"cd "$OLDPWD"\C-m"' # Hint: You could also type '~-'
# FM prompt appearance
if [[ $(whoami) == 'root' ]]; then
# So that the user knows if they have root privileges:
PS1="\[\e[0;32\]mf\[m\e[m\] \[\e[0;31m\]root\[\e[m\] \[\e[0;34m\]\w \[\e[m\]\[\e[0;31m\]> \[\e[m\]"
else
PS1="\[\e[0;32\]mf\[m\e[m\] \[\e[0;34m\]\w \[\e[m\]\[\e[0;31m\]> \[\e[m\]"
fi
# Functions
# Usage
fmhelp () {
echo "hide - toggle hidden (hidden by default)
ls - lists contents of dir(s) passed in args.
lsd - list directories
cd - changed to directory \$1
cp \$@ \$2 - copies file from \$1 to \$2
mv \$@ \$2 - moves file from \$1 to \$2
rm \$@ - deletes \$@
sc \$1 \$2 - make a shortcut called \$1 pointing to \$2. If no \$2 is passed, it is evaluated as \$PWD
cpwd - copy current working directory
.., ..., .... - cd .. etc.
o \$1 - opens \$1 with xdg-open
hm - how many files are in the current directory
details - show file details (ls -lh)
fmhelp - this help menu
n - Intelligent guess of the next dir you wish to cd to. Last $1 in open, list, or makedir; last argument in copy or move; pwd before a cd
~- - BASH shortcut for \$OLDPWD
img - feh frontend with the following usage:
img -t \$2 - views the dirs/images specified in \$2..\$n as clickable thumbnails
img -s \$2 \$3 - views the images specified in \$3..\$n as a slideshow with a slide change speed of \$2 seconds
img \$@ - views the dirs/images specified
Shortkeys:
Ctrl-f - mkdir
Ctrl-h - hide
Ctrl-l - ls
Ctrl-n - cd \$n
Ctrl-o - details
Ctrl-p - cd \$OLDPWD
Ctrl-y - cpwd
Ctrl-u - clear line # urxvt default"
# Toggle display hidden files
# If $showHidden is 1, hidden files are shown
hide () {
showHidden=$(( 1 - $showHidden ))
list
# Toggle display file details
# If $showDetails is 1, file details are shown
details () {
showDetails=$(( 1 - $showDetails ))
list
# ls
listToggle () {
if [[ $showHidden == 1 && $showDetails == 1 ]]; then
ls -C --color -A -lh "$dir"
elif [[ $showHidden == 1 && $showDetails == 0 ]]; then
ls -C --color -A "$dir"
elif [[ $showHidden == 0 && $showDetails == 1 ]]; then
ls -C --color -lh "$dir"
else
ls -C --color "$dir"
fi
list () {
clear # Unclutter the screen
# List pwd if no $1
if [[ $@ == "" ]]; then
set '.'
fi
# List multiple folders:
for dir in "$@"
do
listToggle
done
n="$1" # See 'n' in fmhelp
# use feh to view thumbnails/images/slideshow
img () {
case "$1" in
-t) nohup feh --thumbnails "${@:2}" --thumb-height 120 --thumb-width 120 -S filename -d --cache-thumbnails -B black > /dev/null 2>&1 & ;;
-s) nohup feh "${@:3}" -S filename -d -B black --slideshow-delay "$2" > /dev/null 2>&1 & ;;
*) nohup feh "$@" -S filename -d -B black > /dev/null 2>&1 & ;;
esac
list
# cp
copy () {
if [[ $showHidden == 1 ]]; then
pycp --interactive --all "$@"
else
pycp --interactive "$@"
fi
list
n="${@:(-1)}" # n is the last argument (where stuff is moved to)
# mv
move () {
if [[ $showHidden == 1 ]]; then
pymv --interactive --all "$@"
else
pymv --interactive "$@"
fi
list
n="${@:(-1)}"
makedir () {
if [[ $1 == "" ]]; then
read -e n
set "$n"
fi
if mkdir -- "$1"; then
list # Update pwd to show new dir(s) that have been made.
n="$1"
fi
# rm
remove () {
rm -rfI "$@"
list
# open files
o () {
# To use xdg-open
#nohup xdg-open "$1" > /dev/null 2>&1 &
if [ -f "$1" ] ; then
case "$1" in
*.tar.bz2) tar xjf "$1" ;;
*.tar.gz) tar xzf "$1" ;;
*.bz2) bunzip2 "$1" ;;
*.rar) rar x "$1" ;;
*.gz) gunzip "$1" ;;
*.tar) tar xf "$1" ;;
*.tbz2) tar xjf "$1" ;;
*.tgz) tar xzf "$1" ;;
*.zip) unzip "$1" ;;
*.Z) uncompress "$1" ;;
*.7z) 7z x "$1" ;;
*.pdf) nohup zathura "$1" > /dev/null 2>&1 & ;;
*.html) nohup luakit "$1" > /dev/null 2>&1 & ;;
*.blend) nohup blender "$1" > /dev/null 2>&1 & ;;
*.avi) nohup mplayer "$1" ;;
*.wmv) nohup mplayer "$1" ;;
*.rmvb) nohup mplayer "$1" ;;
*.mp3) nohup urxvtc -si -sw -sh 30 -e mplayer "$1" > /dev/null 2>&1 & ;;
*.flv) nohup mplayer "$1" ;;
*.mp4) nohup mplayer "$1" ;;
*.ogg) nohup urxvt -si -sw -sh 30 -e mplayer "$1" > /dev/null 2>&1 & ;;
*.wav) nohup audacity "$1" > /dev/null 2>&1 & ;;
*.jpg) img "$1" ;;
*.jpeg) img "$1" ;;
*.JPG) img "$1" ;;
*.png) img "$1" ;;
*.gif) nohup gpicview "$1" > /dev/null 2>&1 & ;;
*) nohup urxvt -si -sw -sh 30 -e vim "$1" > /dev/null 2>&1 & ;;
esac
else
echo "'$1' is not a valid file"
fi
n="$1"
# Add shortcuts
makeShortcut () {
if [[ $2 == "" ]]; then
set $1 .
fi
echo ""$1"=\""$2"\"
alias "$1"='cd \""$2"\"'
" >> ~/.config/fm/shortcuts
source ~/.config/fm/shortcuts
# Copy pwd to clipboard
cpwd () {
echo \"$(pwd)\" | xclip
# List directories
lsd () {
ls -F "$@" | grep \/$
# Command aliases
alias mv="move"
alias sc="makeShortcut"
alias cp="copy"
alias ls="list"
alias rm="remove"
alias mkdir="makedir"
alias hm="ls -l . | egrep -c '^-'"
list # ls when fm starts
Could all of you fellow file manager-haters post your little tricks, whether just a few lines added to ~/.bashrc or fully fledged files that you source like mine?
Last edited by greenmanwitch (2011-02-07 19:58:40)3]) wrote: once you have video files cluttered all throughout your hard drive and folders all over, thats where the 'bash' filemanager system lacks its use in terms of effectiveness.
Actually, I found this to be one of the best advantages of using bash is that it forces a user to think about file organization and making useful naming schemes for files.
For example, instead of having 1000+ media files in one directory I subcategorize theme by genre or whatever, and then probably subcategorize them again.
Then I usually rename the files to something meaningful, like if I have 50 pictures of my kids birthday, just do a for each loop on the directory and rename all the files donovan_birthdayX.jpg where X is an integer incrementation.
essentially. just don't "have files cluttered all throughout you hard drive and folders all over". and your life will be much happier regardless of how you manage your files. -
How to use bash within sqlplus?
How to use bash within sqlplus?
meaning I am doing something like this to look for files within a particular directory with some condition.
N=0
for i in $(find . -path \*/waiting/* -type f -not -name "SS*" -mmin +120 -print) ; do
testarray[$N]="$i"
echo "$i"
let "N= $N + 1"
done
Output from above script is as follows:
/d1/d2/d3/d4/waiting/abcd.txt
/d1/d2/d31/d42/waiting/pqrs.txt
/d1/d2/d32/d43/waiting/xyz.txt
And now I want to input this data into database with help of insert.
and here is the little pl/sql block to insert the data with looping thing.
sqlplus $CONNECT <<-EOF
DECLARE
Counter integer :=1;
BEGIN
WHILE Counter <= ${no_of_files} LOOP
INSERT INTO stuck_files(COL_DATE,SER_NAME,TYPE_FILE,FILENAME,FILE_STATUS) VALUES (sysdate,'pqrs','pqrs','pqrs','pqrs');
Counter := Counter + 1;
END LOOP;
END;
commit;
exit;
EOF
Mapping is as follows:
COL_DATE,SER_NAME,TYPE_FILE,FILEFILENAME,FILE_STATUS
sysdate,d3,d4,abcd.txt,waiting
sysdate,d31,d42,pqrs.txt,waiting
sysdate,d32,d3,xyz.txt,waiting
any idea how to do that?
Edited by: user9274197 on Apr 28, 2013 5:09 PMuser9274197 wrote:
How to use bash within sqlplus?
meaning I am doing something like this to look for files within a particular directory with some condition.
N=0
for i in $(find . -path \*/waiting/* -type f -not -name "SS*" -mmin +120 -print) ; do
testarray[$N]="$i"
echo "$i"
let "N= $N + 1"
done
Output from above script is as follows:
/d1/d2/d3/d4/waiting/abcd.txt
/d1/d2/d31/d42/waiting/pqrs.txt
/d1/d2/d32/d43/waiting/xyz.txt
And now I want to input this data into database with help of insert.
and here is the little pl/sql block to insert the data with looping thing.
sqlplus $CONNECT <<-EOF
DECLARE
Counter integer :=1;
BEGIN
WHILE Counter <= ${no_of_files} LOOP
INSERT INTO stuck_files(COL_DATE,SER_NAME,TYPE_FILE,FILENAME,FILE_STATUS) VALUES (sysdate,'pqrs','pqrs','pqrs','pqrs');
Counter := Counter + 1;
END LOOP;
END;
commit;
exit;
EOF
Mapping is as follows:
COL_DATE,SER_NAME,TYPE_FILE,FILEFILENAME,FILE_STATUS
sysdate,d3,d4,abcd.txt,waiting
sysdate,d31,d42,pqrs.txt,waiting
sysdate,d32,d3,xyz.txt,waiting
any idea how to do that?
Edited by: user9274197 on Apr 28, 2013 5:09 PMhttp://asktom.oracle.com/pls/asktom/f?p=100:11:::::P11_QUESTION_ID:439619916584
Cheers, -
How to Upload Excel sheet in DB or internal table using SAP NetWeaver ABAP
Dear All experts,
Pls provide guidance to Upload Excel sheet in DB or internal table using ABAP in ( SAP NetWeaver stack )
Regards
Machindra
Edited by: Machindra Patade on Apr 8, 2010 3:07 PMPlease search before posting.
Thread locked.
Thomas -
Appending a creation date/time stamp to a filename using MS Command Language
I need to access the creation date and time of an existing file and then append that date/time to the filename using MS command language in a .bat file. The code executes on a Windows server. I'm looking at different options for doing
this. I know it can be done using MS Powershell scripting. Any other suggestions appreciated. ThanksI tested the answer you supplied here:
http://social.technet.microsoft.com/Forums/en-US/38873a13-f3f2-40f2-bb96-c1c63722caab/adding-a-datetime-stamp-to-a-file-using-ms-command-language?forum=winserverpowershell
and it worked.
Richard Mueller - MVP Directory Services -
Using one public ip for ssh`ing to different internal servers using port-redirections
Hi, we are having a requirement to use the same public IP to ssh into different internal servers using port re-direction. So lets say from outside, if a user does ssh @ root 4.4.4.4 2222, it should go to a sshsrv1 and then ssh @ root 4.4.4.4 2223 to sshsrv2
My config is like this:-
object network sshsrv1
host 10.110.100.10
nat (inside,Outside) static 4.4.4.4 service tcp 22 2222
And then i allowed the object "sshsrv1" in my inbound acl from outside.
It dosen`t seem to work. Is this doeable?
Any suggestions??Hi,
Would need to see your NAT configurations.
There is a possibility that you have a NAT configuration that might be preventing this from working. Then again you are using an extra public IP address for this so it seems strange.
Could you try the "packet-tracer" command
packet-tracer input outside tcp 12345 2222
This should tell us if there is some problem in the ASA configurations.
- Jouni -
Change Filename using XSLT mapping without variable subtitution
Hi,
My scenario is IDOC to file...i am using XSLT mapping, i want to change the filename format to OUT_<Purchase Number>_<DDMMYYYYhhmmss>_KKKK.txt, i cannot use UDF function as i do XSLT mapping i also i cannot use variable substitution as the target structure doesn't have PO and timestamp as tag elements. Can i acheive using writing a adapter module? I appreciate if anyone could help me with this..
Many thanks>
Ravibabu Adari wrote:
> Hi,
> If i go with Option1: what changes i need to do in the file adapter to tell the adapter to pick the filename from XSLT ?
> If i go with Option2: To which element to the target structure should i map the filename using UDF ? do i have to add additional element to the target structure? what changes i need to do in the file adapter to tell the adapter to pick the filename from Message mapping ?
>
> Many thanks
Hi,
in both cases you need to enable file adapter specific properties and enable the file name...
for this you need to use the dynamic configuration properties for the same...
usage of this option using udf in message mapping is rather easy than to use in XSLT...for this you dont need to change the structure in the message mapping...message mapping is just needed for execution of the udf.. thats it..
HTH
Rajesh -
How to extract data from info cube into an internal table using ABAP code
HI
Can Anyone plz suggest me
How to extract data from info cube into an internal table using ABAP code like BAPI's or function modules.
Thankx in advance
regds
AJAYHI Dinesh,
Thankq for ur reply
but i ahve already tried to use the function module.
When I try to Use the function module RSDRI_INFOPOV_READ
I get an information message "ERROR GENERATION TEST FRAME".
can U plz tell me what could be the problem
Bye
AJAY -
Delete row from internal table using field symbol.
Hi friends,
I created dynamic internal table using field symbol. I want to delete some data using where clause.
for example. i want to use like,
DELETE <FS> WHERE KUNNR = WA_KNA1-KUNNR.
Like the above statment it won't work. How i can use delete with where clause in field symbols.
Hope any one can help me.
Thanks and regards
Srikanth. Shi Srikanth,
I think you have to LOOP through the whole internal table and check each line and decide to delete or not:
LOOP at <itab> INTO <wa>.
ASSIGN COMPONENT 'KUNNR' OF STRUCTURE <wa> TO <field>.
CHECK <field> IS ASSIGNED.
IF <field> EQ WA_KNA1-KUNNR.
DELETE ...
ENDIF.
UNASSIGN <field>.
ENDLOOP.
hope this helps
ec -
What kind of technology does the internal microphone use?
Does the internal mic use USB, Bluetooth, or analog technology. (Rosetta Stone voice recorder/analyzer is crashing app)
I am having the same problem with Rosetta Stone voice recorder/analyzer activity. RS told me to wait before going to the next window in the exercise but this did not help. I had the same experience with an older Mac laptop. I will follow up with Apple under warranty.
-
Internal table used by sap in a program
Hi,
I want to know the list of internal tables used in a program (including sap program).
while debugging i want to view the data stored in it.
I know the internal tables used by me. Before loading the program sap will load some information into internal table. How to know that.
Advance Thanks.Internal tables, not transparent ones.
In the old debugger, goto->system areas->internal information and look ITAB_HEADS. This will show you the name of the tables in the system. SYMBDATANM will show you all variables in memory.
In the new debugger, it's even easier. There's a global tab in the variables area, that tells you all variables in memory. And you can see the variable type - i.e. if it is a table.
matt -
Final Internal Table used in MIGO Transaction
Hi Experts,
I need to know the final internal table used in the MIGO transaction. Why I want to know this is, I need all the records which are there in the table control (GODYNPRO) of the MIGO transaction. I have used the BADI BADI MB_MIGO_BADI to read the values. But since it is a table control the values are getting changed when the user scrolls down the table control. How can I get all the values shown in this table control. Is there any global internal table in the SAPLMIGO program?
BR.Hi ABAP,
Check the BADI MB_MIGO_BADI the example class CL_EXM_IM_MB_MIGO_BADI
In attributes tab variable GT_EXTDATA contains all migo positions.
Read the internal table to check items.
in this method the internal table is filled.
Therefore define your internal table in the class attributes.
I hope you help. -
Goods Issue Internal Order using MIGO
Dear All,
I want to do Goods Issue Internal Order using MIGO, but then an error message popup says
"Order xxx not found or not permitted for goods movement"
When i do the Goods Issue using MB1A, the transaction run well,
So why MIGO transaction cannot run this transaction?
Any one who can help to resolve this problem?
Regards,
MarufatHi,
Go to MB1A, enter Mvt type 261, Plant and S.loc.
Don't click on order tab from the initial screen. This field is for "Production Order" Not for internal order.
Then in the second screen on account assignment data, give your Internal Order number and enter the data and post the document.
Or else, In mIGO, Goods Issue- Others.
Check the configuration for the Order type in transaction code KOT2_OPA.
Order Category should be 01
If order belongs to order category 30,system will not allow to do the direct posting through MB1A.
OR else try to create a reservation for these materials with movement type 261 and then do a goods issue for that reservation.
Hope it will help you
regards
Siva -
How to join THREE different tables into internal table using one select statement .
How to join THREE different tables into internal table using one select statement .
Hi experts,
I would like to request your guidance in solving the problem of joining the data from three different database tables into one internal table
Scenario:
Database tables:
SPFLI
SFLIGHT
SBOOK.
Table Fields:
SPFLI - CARRID CONNID COUNTRYFR CITYFRM COUNTRYTO CITYTO
SFLIGHT - CARRID CONNID FLDATE SEATSMAX SEATSOCC SEATSMAX_C
SEATSOCC_C SEATSMAX_F SEATSOCC_F
SBOOK - CARRID CONNID CLASS
MY INTERNAL TABLE IS IT_XX.
Your help much appreciated.
Thanks in advance.
Pawan.Hi Pawan,
please check below codes. hope it can help you.
TYPES: BEGIN OF ty_xx,
carrid TYPE spfli-carrid ,
connid TYPE spfli-connid ,
countryfr TYPE spfli-countryfr,
cityfrom TYPE spfli-cityfrom ,
countryto TYPE spfli-countryto,
cityto TYPE spfli-cityto ,
fldate TYPE sflight-fldate ,
seatsmax TYPE sflight-seatsmax ,
seatsocc TYPE sflight-seatsocc ,
seatsmax_b TYPE sflight-seatsmax_b,
seatsocc_b TYPE sflight-seatsocc_b,
seatsmax_f TYPE sflight-seatsmax_f,
seatsocc_f TYPE sflight-seatsocc_f,
class TYPE sbook-class,
END OF ty_xx,
t_xx TYPE STANDARD TABLE OF ty_xx.
DATA: it_xx TYPE t_xx.
SELECT spfli~carrid
spfli~connid
spfli~countryfr
spfli~cityfrom
spfli~countryto
spfli~cityto
sflight~fldate
sflight~seatsmax
sflight~seatsocc
sflight~seatsmax_b
sflight~seatsocc_b
sflight~seatsmax_f
sflight~seatsocc_f
sbook~class
INTO TABLE it_xx
FROM spfli INNER JOIN sflight
ON spfli~carrid = sflight~carrid
AND spfli~connid = sflight~connid
INNER JOIN sbook
ON spfli~carrid = sbook~carrid
AND spfli~connid = sbook~connid.
Thanks,
Yawa -
International call using another LD provider calling card
international call using another LD provider calling card
last month i used another LD (non-Verizon) provider calling card for one international call. i check my Verizon International calling plan and it says No International Plan Included.
this month March i was shocked to see my bill for one International call for $408.39
this has never happened before. what is happening here ?In efforts to avoid duplicate/cross posting on the forums, this thread has been locked. Please check for responses to your original thread >> HERE
If a forum member gives an answer you like, give them the Kudos they deserve. If a member gives you the answer to your question, mark the answer that solved your issue as the accepted solution.
Maybe you are looking for
-
How to disable Top sites icon in Favorites bar?
I have upgraded to Mavericks and there are two issues that make me regret the move. The first is small sounding but it makes me so angry I can't see straigh. In a Google sort of way, the new version of Safari foists upon me that miserable button -
-
Apple Loops Custom brower (adding samples)
Does anyone know if it's possible to custom change the category of music you put your loops into? For example I create 3 samples and would like to add them to apple loops utility so during production I can test them out over other parts in a song to
-
Currently I am only able to access 1.8TB. I am sure the fix is easy. Pleae help. Using a startech USB device to mount. Thank you.
-
Name of track changes to modified date when importing mp4
I have two .mp4 files: (both names listed below are the filenames) Valentines Day Torin.mp4 with a modified filed date of 02/15/2010 Phoebe Confirmation Entrance.mp4 with a modified date of 03/18/2010 When I import the Valentines Day Torin file, the
-
i am having a little trouble trying to get cfexecute to create a symbolic link on linux. i am using the below cfexecute tag to try and mimic what i am doing from the command line, but no link is made and no output is received from the cfexecute tag.