All Forums |
Register |
Login |
Search |
Subscriptions |
My Profile |
Inbox |
Tool Warehouse |
FAQs |
Resources |
Help |
Member List |
Address Book |
Logout |
|
|
Prob with bash
|
Logged in as: Guest |
Users viewing this topic: none |
|
Login |
|
|
Prob with bash - Mar. 8, '06, 2:31:46 AM
|
|
|
DeathWolf
Posts: 12
Joined: Mar. 7, '06,
Status: offline
|
j=""; j=$(echo file_ss.jpg | sed 's/jpg/jpeg/'); echo $j
should return file_ss.jpeg
(ksh returns it fine)
bash always returns empty
locale is win-ja_JP.windows-932,
and bash version is GNU bash, version 3.00.0(2)-release (i586-pc-interix3)
EDIT: j=""; j=`echo file_ss.jpg | sed 's/jpg/jpeg/'`; echo $j
does exhibit the same behaviour too... all of it seems really weird...
is there any sort of magic variable i modded by error maybe?
< Message edited by DeathWolf -- Mar. 8, '06, 7:09:39 AM >
|
|
|
RE: Prob with bash - Mar. 8, '06, 1:28:07 PM
|
|
|
Rodney
Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: online
|
If you set the locale to 'C' does it work then? (LC_ALL="C")
|
|
|
RE: Prob with bash - Mar. 8, '06, 4:07:34 PM
|
|
|
DeathWolf
Posts: 12
Joined: Mar. 7, '06,
Status: offline
|
<22:06:34> pkcahier@eugenie:~$ export LC_ALL=C LANG=C
<22:06:39> pkcahier@eugenie:~$ locale
LANG=C
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=C
<22:06:40> pkcahier@eugenie:~$ j=""; j=$(echo file_ss.jpg | sed 's/jpg/jpeg/'); echo $j
<22:06:48> pkcahier@eugenie:~$
In case it helps:(stripped off of obviously completly useless vars)
<22:06:48> pkcahier@eugenie:~$ set
ALLUSERSPROFILE='C:\Documents and Settings\All Users'
APPDATA='C:\Documents and Settings\pkcahier\Application Data'
BASH=/usr/local/bin/bash
BASH_VERSINFO=([0]="3" [1]="00" [2]="0" [3]="2" [4]="release" [5]="i586-pc-interix3")
BASH_VERSION='3.00.0(2)-release'
COLUMNS=140
COMMONPROGRAMFILES='C:\Program Files\Common Files'
COMPUTERNAME=EUGENIE
COMSPEC='C:\WINDOWS\system32\cmd.exe'
DIRSTACK=()
DISPLAY=localhost:0.0
EDITOR=vi
EUID=197611
FP_NO_HOST_CHECK=NO
FTP_PASSIVE=1
GROUPS=()
HISTFILE=/dev/fs/D/Interix/.bash_history
HISTFILESIZE=500
HISTSIZE=500
HOME=/dev/fs/D/Interix
HOMEDRIVE=C:
HOMEPATH='\Documents and Settings\pkcahier'
HOSTNAME=eugenie
HOSTTYPE=i586
IFS=$' \t\n'
INTERIX_ROOT=/dev/fs/C/WINDOWS/SFU/
INTERIX_ROOT_WIN='C:\WINDOWS\SFU\'
LANG=C
LC_ALL=C
LD_LIBRARY_PATH=/usr/lib:/usr/X11R6/lib:/usr/local/lib
LINES=60
LOGNAME=pkcahier
LOGONSERVER='\\EUGENIE'
MACHTYPE=i586-pc-interix3
MAILCHECK=60
NUMBER_OF_PROCESSORS=1
OPENNT_ROOT=/dev/fs/C/WINDOWS/SFU/
OPTERR=1
OPTIND=1
OS=Windows_NT
OSTYPE=interix3
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/bin:
/opt/gcc.3.3/bin:/usr/contrib/bin:/usr/X11R6/bin:/usr/local/bin:/usr/contrib/win32/bin
PATHEXT='.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH'
PIPESTATUS=([0]="0")
PKG_PATH=ftp://ftp.interopsystems.com/pkgs/3.5
PPID=3459
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER='x86 Family 15 Model 31 Stepping 0, AuthenticAMD'
PROCESSOR_LEVEL=15
PROCESSOR_REVISION=1f00
PROGRAMFILES='C:\Program Files'
PROMPT='$P$G'
PS1='<\t> \u@\H:\w$ '
PS2='> '
PS4='+ '
PWD=/dev/fs/D/Interix
SESSIONNAME=RDP-Tcp#5
SFUDIR='C:\WINDOWS\SFU\'
SFUDIR_INTERIX=/dev/fs/C/WINDOWS/SFU/
SHELL=/usr/local/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
SHLVL=2
SYSTEMDRIVE=C:
SYSTEMROOT='C:\WINDOWS'
TERM=xterm
UID=197611
USERDOMAIN=EUGENIE
USERNAME=pkcahier
USERPROFILE='C:\Documents and Settings\pkcahier'
WINDIR='C:\WINDOWS'
XAPPLRESDIR=/usr/X11R6/lib/X11/app-defaults
XCMSDB=/usr/X11R6/lib/X11/Xcms.txt
XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
XNLSPATH=/usr/X11R6/lib/X11/locale
_=echo
_PSXLIBPATH='C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Bitvise Tunnelier;
C:\Program Files\Executive Software\Diskeeper\;C:\Program Files\WinSCP3\;
C:\Program Files\doxygen\bin;C:\PROGRA~1\ATT\Graphviz\bin;C:\WINDOWS\ant\bin;
C:\Program Files\Java\jdk1.5.0_05\bin;C:\Program Files\Objective Caml\bin;
C:\Program Files\Common Files\Adobe\AGL;C:\Program Files\QuickTime Alternative\QTSystem\;
C:\WINDOWS\SFU\common\;C:\Program Files\MKVtoolnix'
j=
< Message edited by DeathWolf -- Mar. 8, '06, 4:08:57 PM >
|
|
|
RE: Prob with bash - Mar. 8, '06, 4:34:19 PM
|
|
|
Rodney
Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: online
|
Since I didn't mention it before: the test code works for me in bash.
It works for me in the locales of 'C' and 'POSIX' and 'win-ja_JP.windows-932'
(I still happen to be running it from the vi-JPN port a few years ago).
It works when I start bash from another shell and on it's own.
That nothing changes when DeathWolf changes the locale (plus the
same here) seems to be a strong indicator that locale has zippo to do with
the problem on his machine.
I don't see anything in the env vars to give a clue.
The "j" at the end of the env vars should be set to "file_ss.jpeg" instead of "".
So it's like the subshell isn't getting run after the initial 'j=""'.
Do you have echo aliased to something?
What happens when you run it with full pathsnames?
j=""; j=$(/bin/echo file_ss.jpg | /bin/sed 's/jpg/jpeg/'); /bin/echo $j
|
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
|
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts |
|
|
|