It appears on solaris 8 I have extended set here --> /usr/xpg4/bin/ls
These are the X/Open versions of some Unix programs, but the filename generation/globbing
is a shell feature, the ls program doesn't see the glob, it sees the expanded list of filenames.
Quote:
But I am not sure where in your reg.exp you are telling it to act only on folder names(column 9).
I'm just passing the filenames to the ls program, ls operates directly on filenames, no need to specify any column
(if I understand the question correctly ...)
Quote:
Also why can't we tell extended globber to understand something like
this -->
And you don't even need the -1 option in this context.
P.S. Actually, if you don't need the modification time info, you don't need the external commands ls and grep either, with ksh (or bash and extglob enabled) you could simply:
Above commands would have listed only folders that are matching if it can get something like this working
Quote:
ls -lt | grep !(*[!1-9]*)
Regarding why I started using awk instead of egrep, I also needed to filter folders based on thier owner. Here is what I have so far working.. I am trying to delete lot of old folders under /var/tmp
Ideally I would want to use parameter for this also -->
Quote:
^[1-9]+$|sjs*|JCE*
. But I could not get it to work.
I am all for not using expensive awk,, instead get this done by printf or bash's extglob or egrep( but I want to use parameters for all my search strings,,).
Last edited by kchinnam; 09-02-2010 at 11:22 PM..
Reason: formatting
Above commands would have listed only folders that are matching if it can get something like this working
So just add -d option to ls:
Quote:
Regarding why I started using awk instead of egrep, I also needed to filter folders based on thier owner. Here is what I have so far working.. I am trying to delete lot of old folders under /var/tmp
Ideally I would want to use parameter for this also --> . But I could not get it to work.
I am all for not using expensive awk,, instead get this done by printf or bash's extglob or egrep
( but I want to use parameters for all my search strings,,).
Well, as it often happens, you begin with a simple question and you end up with a completely different requirement.
You do use parameters for all your search strings. Could you please elaborate further?
I'm having an issue with bash read input when using a case statement.
The script halts and doesn't read the input on the first loop. if I hit enter then the scripts starts to respond as expected. Need some help here.
defaultans=8hrs
read -e -i $defaultans -p "${bldwht}How long would you like... (5 Replies)
Below is what i have in my script.
htcount=$(curl -s --user tomcatstatus:tomcatstatus http://`hostname`.mypc.com:887/manager/jmxproxy?qry=Catalina:type=ThreadPool,name=\"http-nio-887\" |grep sBusy | cut -d ' ' -f2)
echo $htcount
if ; then
echo "more than 10"
else
echo "Less than 10"
fi... (6 Replies)
Hey guys,
I'm really new to all this side of computing and have just had this box sort of left with me and it peaked my curiosity. So i would up here in a desperate bid to find out what the hell it is because although its sort of obvious what it is, no where online is able to give me a detailed... (5 Replies)
Hi Guys,
I want to create a shell script that will give me the output below. I want to insert the numbers from the input file to my url addresses below. And from the numbers below, I want to separate the last digit with a period (i.e. from 222222222222 to 22222222222.2). Appreciate any help.... (14 Replies)
Again, I am in need of some advice.
Earlier I was shown how to have awk create folders for me. That was so cool and helpful, but now I am exploring the posibilities of combining operations with bash scripts.
Now, I am creating the directories with the bash script, and then I want awk to... (1 Reply)
Well i use the following statement in a script to calculate the all column value of a ls command :
find . -name *.leon -exec ls -al {} \;|awk '{c+=$5} END {print c}'
And this is the result :
2.34546e+09
i would know what is exactly the "c+" role , and what i must modify to have the result... (8 Replies)