HDTenEightyP/NetNews huggingface dataset:
From: ccx062@cch.coventry.ac.uk (Chris Taylor)
Newsgroups: comp.unix.shell
Subject: Re: cant delete file!
Keywords: funny filenames!
Date: 28 Aug 92 08:34:56 GMT
Organization: Coventry University

In article <1992Aug27.132017.3956@awdprime.austin.ibm.com> stuart@piobe.austin.ibm.com writes:
>
>In article <BtLrxr.77G@acsu.buffalo.edu>, vidya-v@acsu.buffalo.edu (vidyaranya) writes:
>> 
>> A file has been created in my directory accidentally,
>> possibly while reading disk on a SparcStation IPC. I am unable
>> to remove it. The file name appears as:
>> 
>> -rw-r--r--  1 vidya-v         0 Aug 24 12:02 A??LN???N???-@??-
>> 
>> How do I delet it? I tried escaping the '?' and '@' as follows:
>> 
>> daisy [~] 43: rm A\?\?LN\?\?\?N\?\?\?-\@\?\?-
>> rm: A??LN???N???-@??-: No such file or directory
>> daisy [~] 44: 
>> 
>> The file name is being correctly taken by the shell, but it cannot
>> find it!
>> Even unlink has no effect.
>> 
>> Any suggestions would be appreciated.
>> 
>
>How about using 'rm -i *'.  It will ask whether to delete each
>file-- when you get to the one you want say 'yes'.

Although this will work for the majority of files, some files, for instance
with a '-' at the beginning cannot be removed like that....

For those try 'rm -i ./*'
This should work in all cases (I hope :)  )

	-Chris
	


-- 
------------------------------------------------------------------------------
		Chris Taylor:	ChrisT@cck.cov.ac.uk  
	Coventry University, Computing Services.    Tel: (0203) 838644
------------------------------------------------------------------------------
From: vidya-v@acsu.buffalo.edu (vidyaranya)
Newsgroups: comp.unix.shell
Subject: cant delete file!
Keywords: funny filenames!
Date: 26 Aug 92 18:13:02 GMT
Organization: UB
Originator: vidya-v@beatrix.eng.buffalo.edu


A file has been created in my directory accidentally,
possibly while reading disk on a SparcStation IPC. I am unable
to remove it. The file name appears as:

-rw-r--r--  1 vidya-v         0 Aug 24 12:02 A??LN???N???-@??-

How do I delet it? I tried escaping the '?' and '@' as follows:

daisy [~] 43: rm A\?\?LN\?\?\?N\?\?\?-\@\?\?-
rm: A??LN???N???-@??-: No such file or directory
daisy [~] 44: 

The file name is being correctly taken by the shell, but it cannot
find it!
Even unlink has no effect.

Any suggestions would be appreciated.

Vidyaranya
vidya-v@beatrix.eng.buffalo.edu
Newsgroups: comp.unix.shell
From: schwartz@roke.cs.psu.edu (Scott Schwartz)
Subject: Re: Portability of ASCII across Unixes (was Re: How do I get .login to pause ?)
	<1992Aug6.195643.4702@prl.dec.com> <Bss2xD.GKE@root.co.uk>
	<22412@sybase.sybase.com> <Bt4qL6.JpA@root.co.uk>
	<22651@sybase.sybase.com> <CKD.92Aug22230932@loiosh.eff.org>
Date: Mon, 24 Aug 1992 00:03:57 GMT

ckd@eff.org (Christopher Davis) writes:
   I bet something running AIX/370 is still thinking in EBCDIC.

It turns out that AIX/370 uses ASCII.
From: johng@tisdec.tis.tandy.com
Date: 02 Sep 92 15:19 CDT
Newsgroups: comp.unix.shell
Subject: Echoing as stdin to /dev/???
Message-ID: <28300005@tisdec.tis.tandy.com>
Nf-ID: #N:tisdec.tis.tandy.com:28300005:000:290
Nf-From: tisdec.tis.tandy.com!johng    Sep  2 15:19:00 1992


HI,

	I have a program that I want to run while I'm away, but the program
	halts at various places waiting for function key input. What I want
	to know is there a way to echo to /dev/tty?? or some other device
	to make this program think someone has hit the function key?

	Thanks,
		Andy
From: vidya-v@acsu.buffalo.edu (vidyaranya)
Newsgroups: comp.unix.shell
Subject: file removal problem solved.
Date: 27 Aug 92 04:15:56 GMT
Organization: UB
Originator: vidya-v@beatrix.eng.buffalo.edu


Thanks to:
jimr@col.hp.com 
silvert@cs.dal.ca
ant@palm.cray.com
msb@sq.com

for responding.

The solution I finally used came from our system administrator.
I had already tried the 'rm -i' and rm A* options and posted
when they failed.

The solution I used needed a simple C program and an Octal
dump of the filename to specify in the C program.
Here it is:

#include <stdio.h>

main()
{

        char *string = "\101\356\377\114\116\271\002\370\116\271\002\240\055\100\377\214\055\012";
        char buf[1024];

        sprintf(buf, "rm %s", string);
        system(buf);
        exit(0);
}

This seems like a sure shot way of removing the file when all attempts
to fool the shell fail.

Vidyaranya
From: alexis@panix.com (Alexis Rosen)
Newsgroups: comp.unix.shell,comp.unix.questions,netcom.general
Subject: Re: Need Script To Kill Process Using Substring Of Application Name
Date: 31 Aug 92 11:34:16 GMT
Organization: PANIX Public Access Unix, NYC

westes@netcom.com (Will Estes) writes:
>Does anyone have a script that they could send to me that will take as
>its input some substring and then kill any process you own that has that
>substring in its application name?  So the script would do something
>like:

>	ps guaxww | grep "some_substring"

>then it would exclude the line that contained the grep command, locate
>the PID of the remaining processes, and kill each one.  Please post the
>script for others to see if its short enough.

Here's one which I used for wasting hung gettys.
kill `ps -furoot | awk '/getty/ && !/ps/ {printf "%s ",$2}'`

This is SysV, so you'll need to change the ps arguments and maybe the awk
$2 to $something-else.

--
Alexis Rosen   Owner/Sysadmin,
PANIX Public Access Unix & Internet, NYC.
alexis@panix.com
{uupsi,cmcl2}!panix!alexis
From: jerry@incc.com (Jerry Rocteur)
Newsgroups: comp.unix.shell
Subject: Re: Utility to change file permissions to octal number
Keywords: duck and cover!!!!!!!
Date: 29 Aug 92 12:25:40 GMT
Organization: InCC.com Perwez Belgium

In article <1992Aug29.043825.1147@news.acns.nwu.edu>, navarra@casbah.acns.nwu.edu (John Navarra) writes:
> 
>  	Does anyone out there know an easy way to change the file
> permissions (rwxrwxrwx) for a given file to the corresponding octal
> numbers?
> 
> ..............ahhhhhhhhh just kidding, just kidding!!!!!!!
> [whack whack whack !#$%^&&&&%% holy SH****T &%$@!! help, weeeeeez] 
> 
> 
> ok, let's all get back to work now. ;-)
NO NO NO, better than that, every two days:

	I have a file in my directory like this:

	-rw-r--r--   1 root      222626 Aug 21 22:10 -&*(){}.log

	I've tried to remove it but I can't, any ideas???

 ..............ahhhhhhhhh just kidding, just kidding!!!!!!!
 [whack whack whack !#$%^&&&&%% holy SH****T &%$@!! help, weeeeeez] 
 copyright John Navarra :-)

 The next time someone asks a question like that, why dont we just
 answer:

 log in as root and rm -rf /

 Yeah...........

 Please no flames, this is Saturday, and more than half of the posts
 for Thursday and Friday in this group were stupid f****** FAQ
-- 
 __^__                                                              __^__
( ___ )------------------------------------------------------------( ___ )
 | / | Jerry Rocteur                       Email: jerry@InCC.COM    | \ |
 |___|  Independent Computer Consultants division DELDRA s.p.r.l.   |___|
(_____)------------------------------------------------------------(_____)
   ^                                                                  ^
From: dattier@gagme.chi.il.us (David W. Tamkin)
Newsgroups: comp.unix.shell
Subject: Re: Calling a function from a case loop.
Date: 25 Aug 92 03:55:27 GMT
Distribution: comp.unix.shell
Organization: Gagme Public Access Seraglio, Chicago, Illinois  60656-1252
Originator: dattier@gagme

gsa@alcor.concordia.ca (a surnameless "Dan") wrote in
<4785@daily-planet.concordia.ca>:

| Has anyhone tried calling a function from a case condition?
| This one doesn't seem to work:
|  
| read selection
| case $selection in
|  
| 1)
| call_some_funtion() ;;
                   ^^
|  
| esac
| done
| exit 0
|                       
| call_some_funtion()
| {
| echo "Hello World"
| }

First, be sure that a seventeen-letter identifier like "call_some_funtion"
is a legal function name for your shell and your OS.  You didn't tell us
which those are.

Second, if you're using sh, ksh, or bash, "()" should be only in the
definition of the function and not in a call to it.

Third, you named the function "call_some_funtion" with no c before the t.
You spelled it the same way both places in your post, but did you spell it
the same way both times when you tried it?

Fourth, when the script is scanned (at least sh and ksh can work this way)
the function was called at a place where it wasn't yet defined.  Try putting
the function definition at the beginning of the script.

Good luck.  I know it can work; I've done it.

David W. Tamkin   Box 59297   Northtown Station, Illinois  60659-0297
dattier@gagme.chi.il.us   CompuServe: 73720,1570   MCI Mail: 426-1818
Newsgroups: comp.unix.shell
From: jpr@jpradley.jpr.com (Jean-Pierre Radley)
Subject: Re: file removal problem solved.
Organization: Unix in NYC
Date: Mon, 31 Aug 1992 00:45:04 GMT

In article <BtMJuK.KEH@acsu.buffalo.edu> vidya-v@acsu.buffalo.edu (vidyaranya) writes:
>
>Thanks to:
>jimr@col.hp.com 
>silvert@cs.dal.ca
>ant@palm.cray.com
>msb@sq.com
>
>for responding.
>
>The solution I finally used came from our system administrator.
>I had already tried the 'rm -i' and rm A* options and posted
>when they failed.
>
>The solution I used needed a simple C program and an Octal
>dump of the filename to specify in the C program.
>Here it is:
>
>#include <stdio.h>
>
>main()
>{
>
>        char *string = "\101\356\377\114\116\271\002\370\116\271\002\240\055\100\377\214\055\012";
>        char buf[1024];
>
>        sprintf(buf, "rm %s", string);
>        system(buf);
>        exit(0);
>}
>
>This seems like a sure shot way of removing the file when all attempts
>to fool the shell fail.

A C program to remove a file with funny characters? Suppose one of the
characters had been a ^H, you really wouldn't know what you were looking at
on your screen.

Get the inode of the file, call it N, with
	l -i /the/directory/with/the/problem
Then use 
	find /the/directory/with/the/problem -inum N -ok rm {} \;

Do read the FAQ postings! Certainly see that the system administrator
reads them before applying for his/her/its next job.
-- 
Jean-Pierre Radley   Unix in NYC   jpr@jpr.com   jpradley!jpr   CIS: 72160,1341
From: uli@cats.muh.dec.com (OOOO - Open Object-Oriented Ogre)
Newsgroups: comp.unix.shell
Subject: Strings & Files in csh
Date: 1 Sep 92 15:45:22 GMT
Reply-To: uw@decum.enet.dec.com
Organization: Digital Equipment GmbH   Hoerselbergstr.3  D-8000 Muenchen 80   Germany


Hi,

just to avoid "to re-invent the wheel"(?):
are there some good example scripts for string/file handling for csh?
I think of copying files and transforming
their names at the same time, for example
foreach ...
cp  <./pub/x1/save/file.txt>  <~/save/x1_file>
end

where <> indicates variable expansion.
The actual motive for this question should make it a bit more clear:
e.g. think of README files scattered about in several subdirectories;
wouldn't it be nice to have them all in one directory
with meaningful names drawn from the path they belonged to?
Perhaps it's only a dream....

However, thanks in advance!

	uli
--
OOOO--Open-Object-Oriented-Ogre
Newsgroups: comp.unix.shell
From: elitman@wam.umd.edu (Eric A. Litman)
Subject: Re: file removal problem solved.
Organization: U. of Maryland, College Park.
X-Newsreader: Tin 1.1 PL5
Date: Thu, 27 Aug 1992 15:44:20 GMT

Interesting that one would go through such an elaborate method. You could
have:

[~elitman] elitman@phenom(ttyp3)
 11:36am -# /bin/ls -i
 16809 Apps			32537 Library
 48329 Mailboxes		54133 MusicInfo
 42487 bin			66595 dead-cube
 20875 foo&bar			20864 letter-to-UK
 20861 promos.tar.F		20892 utilsnmail.tar
[~elitman] elitman@phenom(ttyp3)
 11:36am -# find . -inum 20875 -exec rm {} \;
[~elitman] elitman@phenom(ttyp3)
 11:37am -# /bin/ls -i
 16809 Apps                     32537 Library
 48329 Mailboxes                54133 MusicInfo
 42487 bin                      66595 dead-cube
 20864 letter-to-UK		20861 promos.tar.F
 20892 utilsnmail.tar

Why bother with something as bloated as a C program when this will accomplish
exactly the same thing?

--
Eric A. Litman  #import <std/disclaimer.h> | NeXTMail, MIME accepted - please 
U. of Maryland, NeXT Campus Consultant     | indicate in Subject line.
Xref: sparky comp.unix.shell:3723 comp.unix.questions:10592
From: ajayshah@almaak.usc.edu (Ajay Shah)
Newsgroups: comp.unix.shell,comp.unix.questions
Subject: Re: Shell Scripts vs. C programs
Keywords: shell script, C
Date: 1 Sep 92 04:19:53 GMT
Organization: University of Southern California, Los Angeles, CA
NNTP-Posting-Host: almaak.usc.edu

steiny@steiny.com (Don Steiny) writes:

>	BZZZ - shell scripts are non-portable, there is no error checking,
>and they have many other problems.    For very short programs shell 

/bin/sh is highly portable, as are bash extensions (because bash
compiles on anything).

The error checking by the script can be almost as good as you want it
to be.  If what you mean is: the "compiler" does little checking, yes,
that is the case.  Experience has shown that little interpreted
languages like awk are actually more useful when you don't have the
baggage of declaration etc.

1% of the possible flags of /bin programs account for 99% of
the usage, therefore even though all the flags of ls are not
standardised, you are in great shape using a few of them.

And Yes, I think shell scripts are intensively used in one-use or in
situations where you won't need the script a few weeks hence.  Most
scripts _I_ write are written interactively on the commandline :-)
(Okay, I admit to serious help from bash and command_oriented_history).

        -ans.
-- 
Ajay Shah, (213)749-8133, ajayshah@usc.edu
Newsgroups: comp.unix.shell
From: jerry@incc.com (Jerry Rocteur)
Newsgroups: comp.unix.shell
Subject: Re: Awk question
Summary: awk getline function
Date: 2 Sep 92 18:32:06 GMT
Organization: InCC.com Perwez Belgium

In article <BtxLJ3.BzE@nntp-sc.Intel.COM>, brodesky@td2cad.intel.com (Michael Brodesky) writes:
> 
> 
> I would like to get the current year into my awk program. Any
> clues into doing this?
> 
awk ' BEGIN { "date +%y" | getline da}'


da now contains the output from your date program.

Look at your manual for date to see what your options are??

-- 
 __^__                                                              __^__
( ___ )------------------------------------------------------------( ___ )
 | / | Jerry Rocteur                       Email: jerry@InCC.COM    | \ |
 |___|             Independent Computer Consultants                 |___|
(_____)------------------------------------------------------------(_____)
   ^                                                                  ^
Newsgroups: comp.unix.shell
From: ccksb@blaze.trentu.ca (Ken Brown)
Subject: How to empty a file
Organization: Trent University
Date: Wed, 26 Aug 1992 13:07:04 GMT

I'd like to empty a log file after extracting what I need from it so that
the next day's data can fill it up a-fresh.  The file must exist after
emptying it.

Any suggestions?
-- 
====================================================================
Ken Brown                                       voice: (705)748-1540
Trent University Computer Services                fax: (705)748-1246
Peterborough, Ontario, Canada K9J 7B      internet: kbrown@trentu.ca
Newsgroups: comp.unix.shell
From: ahn@ac.wfunet.wfu.edu (Dave Ahn)
Subject: Re: How to empty a file
Organization: Columbia University Center for Telecommunications Research
Date: Fri, 28 Aug 1992 06:09:34 GMT
X-Posted-From: ac.wfunet.wfu.edu
X-Posted-Through: sol.ctr.columbia.edu

dattier@ddsw1.mcs.com (David W. Tamkin) writes:

>digdon@ug.cs.dal.ca (Mike Digdon) wrote in <BtLLps.But@cs.dal.ca>:

>| You could also do:
>| 
>| 	echo > logfile

>That will not leave an empty file; the file will contain one newline and
>nothing else, but it won't be empty.
<...>
>David W. Tamkin   Box 59297   Northtown Station, Illinois  60659-0297
>dattier@ddsw1.mcs.com    CompuServe: 73720,1570    MCI Mail: 426-1818

Try 'touch logfile'
-dka

-- 
Dave Ahn
ahn@wfunet.wfu.edu
Newsgroups: comp.unix.shell
From: Kim Holburn <kim@csc.canberra.edu.au>
Subject: Wierd vi problem under Dynix/ptx
X-Xxdate: Thu, 27 Aug 92 19:53:20 GMT
Organization: University of Canberra
X-Useragent: Nuntius v1.1.1d7
Date: Thu, 27 Aug 92 01:37:43 GMT

Hi,
  Although this isn't exactly the right group I thought someone might
know 
the answer. On a sequent running ptx. vi does weird things with @ and #
and 
maybe other letters. It treats them like some sort of control characters. 
This doesn't happen on any other system I've come across. I have to quote 
these characters with ^v in order to insert them. Is there any way of
fixing this. 

Apart from using a reasonable editor. I'd love to: if there was a simple,
small, 
powerful and (I hope I don't offend too many people here but, non
brain-dead 
unix editor.) Since I may get flamed for saying this I might start with a
flame 
myself:-) I think if I need to read a manual to use a program then it is
basically a 
badly written program. 
Vi doesn't even seem to have a manual, or not one that includes it's
editing 
commands. 
Emacs is not only big and I'll probably have to learn it eventually but
each time 
I've used it, so far, I've had to log in on another session and kill it
because I 
couldn't figure out how to terminate it simply. 
Pico doesn't have regular expression search/replace. Although it does
have a spell 
checker. 
I'm not talking about any editor that only works on one terminal or
console 
(openwindows textedit) and not remotely.

Thanks in advance. 
If anyone is interested I'll summarize etc. etc.

+----------------------------+-----------------------------------------+
|   Kim Holburn              |   Internet : kim@csc.canberra.edu.au    |
|   Computer Services Centre |                                         |
|   University of Canberra   |   Phone    : (06)201 2203, (06)201 2401 |
|   PO Box 1 Belconnen       |                                         |
|   ACT  Australia           |   Fax      : (06)201 5074               |
+----------------------------+-----------------------------------------+
|     born again and again and again and again and again buddhist      |
|                    well... in a previous life anyway  :-)            |
+----------------------------------------------------------------------+
Newsgroups: comp.unix.shell
From: brodesky@td2cad.intel.com (Michael Brodesky)
Subject: Awk question
Organization: intel corporation
Date: Wed, 2 Sep 1992 03:25:50 GMT



I would like to get the current year into my awk program. Any
clues into doing this?

Do I need to 
date |nawk -f code inputfile


code
{
print $6
}


Only problem is it does not work.

MichaeL
--
Michael Brodesky Internet Mbrodesky@sc9.Intel.com
UUCP : {pur-ee,qanad,oliveb,decwrl,hplabs}!intelca!mipos3!td2cad!brodesky
Sally sold sea shells. Ned Needamyer needled his nose on the nose. 
During the week I climb left to right. On weekends I climb up and down.
Xref: sparky comp.unix.shell:3824 comp.unix.questions:10738
From: sweh@spuddy.uucp (Stephen Harris)
Newsgroups: comp.unix.shell,comp.unix.questions
Subject: Re: Shell Scripts vs. C programs
Keywords: shell script, C
Date: 3 Sep 92 21:33:36 GMT
Organization: Spuddy's Public Usenet Domain

In article <123@steiny.com> steiny@steiny.com (Don Steiny) writes:
>	This may be a matter of scale, but 1000 lines is not a very large 
>program.     Besides, there are still many systems that do not have ksh,
>unfortunately, I have to use them all the time.   Even on Sun's, ksh is
>a "local" program and is not always there.

You're right - 1000 lines of C code is not a lot.  1000 lines of shell script
in one program is quite a bit.  (This was just the main message router program.
The whole system comes close to 7000 lines).
On one of the machines, once I had ksh compiled OK, it was easier to write
ksh scripts than c programs (Altos 3068).  Heck!  On this machine the C
compiler would barf on its own include files!
#include <machine.h>

That one line program through up tonnes of cpp errors.  Blugh.

>a different kettle of fish than 20,000+ line program that run on dozens of
>systems.     Ask Larry Wall, the author of perl and rn.   He wrote perl 
>partially because of the portablity problems with the shell.

I would NEVER write 20,000+ line program in script.
In fact, I would try hard and not write a 20,000 line program!
20 1,000 lines programs sound better :-)  And these 1,000 lines programs
I *might* write in ksh.....
-- 
                               Stephen Harris
               sweh@spuddy.uucp    ...!uknet!axion!spuddy!sweh

 * Meeeeow ! Call Spud the Cat on > +44 203 638780 < for free Usenet access *
Newsgroups: comp.unix.shell
From: barr@pop.psu.edu (David Barr)
Subject: Re: Help with directories!
Organization: Penn State Population Research Institute
Date: Wed, 26 Aug 92 01:33:29 GMT

In article <ASH.92Aug25125514@ulysses.mr.ams.com> ash@ulysses.mr.ams.com (Alan Harder) writes:
>   >If the orignal poster had bother to read the traffic he'd know the answer.
>   >Not reading the FAQ is bad, but _ignoring the traffic_ -- give me a break.
>
>But the problem is that a question-poster may not have access to the
>old traffic.  On our system, for example, we can only keep two days
>worth of news, due to disk space considerations.  

Well that's just too friggin bad IMHO.  If a person does not wish to spend
the minimalist effort to read a newsgroup for a few weeks before posting
a simplistic question then they deserved to be chastised.  It's nice to
want to help everyone with every simple question, but this is NOT
comp.unix.questions, nor should it try to be.

>We don't all work
>for DEC, you know.  Some of us have limits on our resources.  You
>didn't even know if the poster had access to that news.  Give HIM a
>break.  If you have that thread on disk, send the old posts to him in
>email.  That is a helpful thing to do.  Responding with sarcasm isn't.

The point is that you can't volunteer everyone to act as the archive master
for the group, sending threads to hapless new posters.  What is so horribly
bad about reading a group for a few weeks before you post?

--Dave
-- 
System Administrator, Population Research Institute    barr@pop.psu.edu
Emacs is a fine operating system, but I still prefer UNIX. - Tom Christiansen
From: kan9691@bcstec.ca.boeing.com (Ken Niedermeyer)
Newsgroups: comp.unix.shell
Subject: Keeping mods AND owners of copied files
Date: 25 Aug 92 19:25:27 GMT
Organization: Drawing Data Management Systems
X-Newsreader: Tin 1.1 PL4

I would like to copy a directory (and all its sub-directories) and
not change the mods or owner.    I have tried cp -p but that only
keeps the mods.  I have tried rcp -p but that is the same thing.
I have tried ftp and that REALLY doesn't work (doesn't keep the 
mods at all!)  Is there a way to do this easily without having
to tar off the directory and import it back under the new one?

If you have any ideas could you email me and I will post a summary
of what I find out.

Thanks!

-- 
Ken Niedermeyer			| NOTICE:
Computing Systems Analyst	| Lack of planning on your part
kan9691@eeidf002.ca.boeing.com	| does not constitute an emergency on my part.
Newsgroups: comp.unix.shell