LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-15-2007, 12:33 AM   #1
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 210Reputation: 210Reputation: 210
Bizarre char set issue?


Code:
jameson@navy:~/pix/oxford_1/CCD (Digital)$ for item in `ls 000*`; do mv $item `echo $item | sed 's/^000//g'`; done
mv: cannot stat `\033[00m\033[01;35m00001.jpg\033[00m': No such file or directory
mv: cannot stat `\033[01;35m00002.jpg\033[00m': No such file or directory
mv: cannot stat `\033[01;35m00003.jpg\033[00m': No such file or directory
mv: cannot stat `\033[01;35m00004.jpg\033[00m': No such file or directory
what on earth is going on here? The files are named like: 00007.jpg
 
Old 11-15-2007, 08:15 AM   #2
Nick_Battle
Member
 
Registered: Dec 2006
Location: Bracknell, UK
Distribution: SUSE 13.1
Posts: 159

Rep: Reputation: 33
Quote:
Originally Posted by jhwilliams View Post
what on earth is going on here? The files are named like: 00007.jpg
Is "ls" an alias for a version which prints listings with pretty colours? (Try "alias" in bash to list your aliases). The --color argument to ls should not produce these escapes if the value is "auto" and the output is not a tty, but it might be "always".

If so, you can either remove the alias (only affects the current shell), or use /usr/bin/ls in the script instead of ls.

HTH,
-nick
 
Old 11-15-2007, 06:14 PM   #3
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Original Poster
Rep: Reputation: 210Reputation: 210Reputation: 210
Oh right; I had in fact just set that alias a moment before. Cheers!
 
Old 11-18-2007, 07:32 AM   #4
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Why were you using:
Code:
for item in `ls 000*`
when
Code:
for item in "000*"
usually produces the same results?
 
Old 11-21-2007, 03:53 PM   #5
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Original Poster
Rep: Reputation: 210Reputation: 210Reputation: 210
Quote:
Originally Posted by archtoad6 View Post
Why were you using:
Code:
for item in `ls 000*`
when
Code:
for item in "000*"
usually produces the same results?
Never tried it that way - my way worked so became habit. Thanks for the short cut!
 
Old 11-22-2007, 12:40 PM   #6
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
You're welcome.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change the char-set when mounting local harddisk benben_shen Linux - Software 0 03-12-2006 09:39 AM
Char set change`? jnusa Programming 2 11-09-2004 03:01 AM
is *- -p = '\n' valid? can i set \n char to a pointer? feetyouwell Programming 1 10-01-2004 02:09 AM
Bizarre DNS issue with graphical browsers. fuzzbucket Linux - Networking 7 03-19-2004 02:42 PM
samba codepage/char set problem Clemente Linux - Software 3 11-25-2003 01:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration