Rieekan
thank you
expecially for TIMTOWTDI, willy sure appreciate it.
sure in unix 20 ways conduces to the same goal
the Q was: why a 20 line code to do a sort?
but sure you are right.
why use a sort when i can do it in a 20 line script.
AGAIN: thhhanks 4 expl of TIMTOWTDI.
DBDGAIK
why people insist solving solved probls ?
to do it easy, put your data in a file, say abc
then enter a
sort abc
do you need numerical sort, enter
sort -n abc
a reversed num sort ?
sort -nr abc
an unique reversed numerical?
sort -nru abc
the best unix tool is called 'man'
to use it try: man...
i suppose your redhat is unix, who cares about size ?
mkdir /where-you-have-space
cd /mounted-cdrom
tar cfb - 126k . |(cd /where-you-have-space; tar xfvp -)
RVSachin: they are simply NOT blanc
as phv said, a line with blancs is NOT a blanc line.
Ygor: elegant :)
my preferred ( == phv's grep )
sed '/^[SpaceTab]*$/d' in >out
#!/usr/bin/perl ### this is unix
so if you are not an obstinate perl fanatic
and accept to use the properly tool for this job...
[i]in your exemple, you make string substitions,
no computing, no conditional stats, so why use perl?[/b]
you could call the easy, old, fantastic sed.
ASSUMED the...
1) check the user, is it 'secure' give him access
else
2) ask 4 pwd
3) let the 'secure' user do the cronjob.
Can I give access to cronjob to run the script? Maybe embedding the password in the cronjob?
no ways(in a standard *nix)
this will not leave cadaver in your dir
#!/bin/sh
# not assuming [k|ba]sh is used
for file in `ls`
do [ -w $file ] || continue
(
echo blabla blabla
cat $file
) >temp.file
mv temp.file $file
done
note: a sed or an here-vi are eleganter.
who cares 'when a userid was created' ?
you want exclude users not active since x-time!
on a s5r4 sys look for inactive flag in: man shadow
BUT
delete users it's not really a good idea.
tomorrow, my be you have to read a backup &&
would like to identify the (deleted) user :)
AND
why delete users...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.