Operating System - HP-UX
1833434 Members
2916 Online
110052 Solutions
New Discussion

viewing and removing extra characters hpux 11i

 
SOLVED
Go to solution
Shivkumar
Super Advisor

viewing and removing extra characters hpux 11i

While moving a directory say /op/rose/pink
some extra characters got added to pink directory as pink^?^?^?^?^?$

how to remove this extra character ?

can this extra character be viewed by only
command $ls | cat -ev

what could be the root cause of these extra characters ?

Regards,
Shiv
7 REPLIES 7
Robert-Jan Goossens
Honored Contributor
Solution

Re: viewing and removing extra characters hpux 11i

Hi Shiv,

Go to the /opt/rose directory

# ls -i

find the inode number for the directory pink^?^?^?^?^?$

# find . -inum xxxx -xdev -exec mv {} pink \;

# ll | grep pink

Hope this helps,
Robert-Jan
Steven E. Protter
Exalted Contributor

Re: viewing and removing extra characters hpux 11i

Shalom Shiv,

cd /op/rose
mv "pink^?^?^?^?^?$" pink

Done.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Chan 007
Honored Contributor

Re: viewing and removing extra characters hpux 11i

Shiv,

when you have any spl charc use " " to move

this will work fine even when you have file like this mv /top/pink/"Test Shiv" /opt/pink/test_shiv

use mv /opt/rose/"ping???"


This may be b'cos of your evn set
check man locale or lacaledef

Chan
Hein van den Heuvel
Honored Contributor

Re: viewing and removing extra characters hpux 11i

[I realize the problem is solved, but for some next time...]

If 'pink' is already unique, then the solution may be as simple as:

cd /opt/rose
mv pink* pink

fwiw,
Hein.
James R. Ferguson
Acclaimed Contributor

Re: viewing and removing extra characters hpux 11i

Hi Shiv:

You already know how to rename or remove the file. You also asked how to view the full filename and how the extra characters appeared.

Using 'cat -etv' is one method to expose non-printing characters. Another is:

# ls | xd

In your specific case, the "^?" couplet was produced by the delete key. You can see this by using 'xd'. A hexadecimal 7F is a DEL character.

Unless you have specifically mapped the delete key, you should be able to reproduce the creation of a file like this by typing:

# touch pinkkkk

...where represents hitting the delete key.

When typed, the keypress should show "^?".

Now do:

# stty erase '''

...Note that I typed the single quote twice before pressing the key.

Now try touching (creating) another file and correct your typing with the key.

A nice companion reference to 'xd' and to output from 'cat -etv' is the manpage for 'ascii(5)'.

Regards!

...JRF...
Yogeeraj_1
Honored Contributor

Re: viewing and removing extra characters hpux 11i

hi,

the root cause of these extra characters must be a sequence of escape characters (not visible on a terminal session) which had been typed accidentally..

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Arunvijai_4
Honored Contributor

Re: viewing and removing extra characters hpux 11i

Hi Shiv,

You may get these characters when stty erase is not configured and when you press "backspace" these characters appear. You can simply move by inode number of the dir or, # mv "/opt/rose/pink* /opt/rose/pink.

Hope this is helpful.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"