Sponsored Content
Full Discussion: Undeletable file
Operating Systems OS X (Apple) Undeletable file Post 303036989 by wisecracker on Friday 19th of July 2019 01:01:07 PM
Old 07-19-2019
This is also my last attempt.
YOU USE THIS AT YOUR OWN RISK!
I discovered that Windows CP 1252 certainly does have these characters as single bytes in it.
Code:
#!/bin/sh

# Windows 1252 code page 8 bit values, (with UTF-8 unicode values shown)...

NULLS=$'\x80\x80'
REG=$'\xAE'
TM=$'\x99'
FILENAME="${NULLS}"'Word Finder'"${REG}"' Plus'"${TM}"

# Should be 20 characters long.
echo "${#FILENAME}"

echo "${FILENAME}"

hexdump -C <<< "${FILENAME}"

##### !!!YOU USE BELOW AT YOUR OWN RISK!!! #####
# rm -f "${FILENAME}"

Example printout:
Code:
Last login: Fri Jul 19 17:52:27 on ttys000
AMIGA:amiga~> cd Desktop/Code/Shell
AMIGA:amiga~/Desktop/Code/Shell> ./Invalid_Filename.sh
20
??Word Finder? Plus?
00000000  80 80 57 6f 72 64 20 46  69 6e 64 65 72 ae 20 50  |..Word Finder. P|
00000010  6c 75 73 99 0a                                    |lus..|
00000015
AMIGA:amiga~/Desktop/Code/Shell> _

REMEMBER! You are messing with a file that is NOT native to OSX 10.11.x.
Save/backup everything you need before removing the final '#' on the last line and then executing this code.
WWW.UNIX.COM and its helpers in this thread do NOT hold any responsibility for anything that goes awry.
 

5 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

undeletable file

when i try to ls -lrt the directory, the "undeletable" file is listed. but when i try to ls -lrt *exe, the "undeletable" file is not listed. this "undeletable" is the file that i want to delete from the directory. but when i try to delete/rename/copy.... it, it show that "No such file or... (10 Replies)
Discussion started by: chxxangie
10 Replies

2. UNIX for Dummies Questions & Answers

Files.... undeletable.

I've some files created by a script. For some reason last time the script run was interrupted for an error and the files produced by the script are undeletable. i've tryed as root with command 'rm' and even if i got no error in command execution the files are still there. These are the... (9 Replies)
Discussion started by: mirrorx
9 Replies

3. Shell Programming and Scripting

Match list of strings in File A and compare with File B, C and write to a output file in CSV format

Hi Friends, I'm a great fan of this forum... it has helped me tone my skills in shell scripting. I have a challenge here, which I'm sure you guys would help me in achieving... File A has a list of job ids and I need to compare this with the File B (*.log) and File C (extend *.log) and copy... (6 Replies)
Discussion started by: asnandhakumar
6 Replies

4. Shell Programming and Scripting

Compare 2 text file with 1 column in each file and write mismatch data to 3rd file

Hi, I need to compare 2 text files with around 60000 rows and 1 column. I need to compare these and write the mismatch data to 3rd file. File1 - file2 = file3 wc -l file1.txt 58112 wc -l file2.txt 55260 head -5 file1.txt 101214200123 101214700300 101250030067 101214100500... (10 Replies)
Discussion started by: Divya Nochiyil
10 Replies

5. Shell Programming and Scripting

Shell script (sh file) logic to compare contents of one file with another file and output to file

Shell script logic Hi I have 2 input files like with file 1 content as (file1) "BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt File 2 contents as fle(2) "BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt I want to get... (22 Replies)
Discussion started by: pottic
22 Replies
URLCODING(3)						 libbash urlcoding Library Manual					      URLCODING(3)

NAME
urlcoding -- a Libbash library for encoding and decoding URL's. SYNOPSIS
urlEncodeString [-l] <STRING> urlEncodeFile [-l] <FILE> urlEncodeStream [-l] urlDecodeString <STRING> urlDecodeFile <FILENAME> urlDecodeStream DESCRIPTION
urlcoding is a collection of functions that convert ASCII-text to standard URL's and vice-versa. The AWK code used is based on code by Heiner Steven <heiner.steven@odn.de> The function list: urlEncodeString Creates a URL from an ASCII string urlEncodeFile Converts a file into URL-valid text urlEncodeStream Converts standard input into URL-valid text urlDecodeString Converts a URL-encoded text back to a plain-text form urlDecodeFile Coverts URL-encoded text in a file back to plain text urlDecodeStream Converts URL-encoded standard input to text Detailed interface description follows. The [-l] option for the encoding functions should be used when line-feed characters (' ') are to be encoded as well. All functions print the results of their conversions to standard output. The exit status of all functions is that of the command 'awk', with '0' for success FUNCTIONS DESCRIPTIONS
urlEncodeString [-l] <STRING> Converts STRING - a string of ASCII characters - to URL. urlEncodeFile [-l] <FILE> Coverts FILE of URL-encoded text to plain text urlEncodeStream [-l] Converts text from standard input to URL-text. urlDecodeString <STRING> Converts URL-encoded string STRING back to text. urlDecodeFile <FILENAME> Converts the URL-encoded text in FILE to plain text. urlDecodeStream Converts the URL-encoded text from standard input to plain-text AUTHORS
Alon Keren <alon.keren@gmail.com> SEE ALSO
ldbash(1), libbash(1) Linux Epoch Linux
All times are GMT -4. The time now is 07:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy