|
|
Up |
|
|
  |
Author: Name withheld by requestName withheld by request
Date: Jul 17, 2008 17:58
in Ex 1 was a fork saved w/r to Ex 2?:
Ex 1
log=$(< /tmp/mylogfile)
echo "$log"
Ex 2
cat /tmp/mylogfile
what about?:
Ex 1
myfilterxx <<<"one line of info here"
Ex 2
echo "one line of info here"|myfilterxx
--
thanks much
|
| |
|
| |
7 Comments |
|
  |
Author: onlinevieweronlineviewer
Date: Jul 17, 2008 10:58
On Jul 17, 1:51Â pm, Bill Marcum bellsouth.net> wrote:
> On 2008-07-17, onlineviewer gmail.com> wrote:
>
>
>
>
>
>> On Jul 17, 12:08Â pm, mop2 wrote:
>>> On Thu, 17 Jul 2008 12:44:49 -0300, onlineviewer gmail.com> wrote:
>>>> hello All,
>
>>>> I am trying to grep exactly 2 digits at the end of a line.
>
>>>> ls -l | grep file.'[2-8][2-8]$'
>
>>>> iI thought that would work, but no luck
>>>> Thanks,
>
>>> ls -l file.[2-8][2-8]
> ...
|
| Show full article (0.86Kb) |
|
| |
7 Comments |
|
  |
Author: PengYu.UTPengYu.UT
Date: Jul 17, 2008 10:50
Hi,
I tried the following command. I don't what bash to report the error
message when there is no *.sh files. Is there a way to do it?
~$ cp /bin/*.sh ./
cp: cannot stat `/bin/*.sh': No such file or directory
Thanks,
Peng
|
| |
|
5 Comments |
|
  |
Author: onlinevieweronlineviewer
Date: Jul 17, 2008 08:44
hello All,
I am trying to grep exactly 2 digits at the end of a line.
ls -l | grep file.'[2-8][2-8]$'
iI thought that would work, but no luck
Thanks,
|
| |
|
6 Comments |
|
  |
Author: nickli2000nickli2000
Date: Jul 17, 2008 08:01
Hi,
I have the following records in a file:
CD NYC Car|0|20|07/10/2008| |6555.25|885|6347|
AB LA Home|0|20|07/15/2008| |885.25|665|4567|
AB BS Finance|0|20|06/22/2008| |675.25|65|877|
....
I need to get the last field of the first field separated by "|",
so the output will be:
Car
Home
Finance
I need to use AWK to do this since I also parse other records in
this file and output them. Here is parts of the code:
awk '/START-OF-DATA/,/END-OF-DATA/ { FS="|"; sp=index($1," "); if
(($0~/\|/) && ($2="0") && sp>4 )\ {print substr($1,sp-4,4),"|",$4,"|",
$5,"|",substr($1,1,sp-5),"|",substr($1,10),"|" } else \
{print substr($1,sp-1,4),"|",$4,"|",$5,"|",substr($1,1,sp-2),"|"}}'
$SOURCEFILE > $DATAFILE
|
| Show full article (0.88Kb) |
|
2 Comments |
|
  |
Author: m.desai18m.desai18
Date: Jul 17, 2008 07:02
I want to extract fields 3,4 and 8 from a file which looks like below:
AAA ,01,001,"XX,YY ",5,10, "AAAA ", 10.25
BBB ,01,002,"XXX,YY ",15,16, "AAAA ", 10.25
CCC ,00,003,"XXYY ",63,156, "AA'BB ", 11
DDD ,00,004,"XXYY.ZZ ",5,10, "AA'CC ", 09.99
Cut command does not work as the field seperator (comma) is part of
field text for field 4 in a few lines.
The table in which I am inserting the fields should look like below:
Table
Field1 Field2 Field3
001 XX,YY 10.25
002 XXX,YY 10.25
003 XXYY 11
004 XXYY.ZZ 9.99
Please let me know how to deal with this.
|
| |
|
5 Comments |
|
  |
Author: rogvrogv
Date: Jul 17, 2008 05:39
How can I parse file names that looks like this:
20080701-051214.filename1.txt
20080803-013412.filename2.txt
so that the files will look like this:
filename1.txt
filename2.txt
|
| |
|
3 Comments |
|
  |
|
|
  |
Author: rudrarudra
Date: Jul 17, 2008 00:20
here is an easier version of what i want to do
Code:
#!/bin/bash
echo "Enter file name"
echo "You can enter maximum 3 file"
for (( i=1; i<=3;i++))
until [ "$*" = "" ]
do
echo "Enter file ${i}"
read fil_$i
done
//do the rest of the code
the probleam is, my input needs three input. but what i want to do is
to put an optin of optional break, say instead of three, i have only
one input ...so, if i put "0", the code should ixit for loop and do
the rest of the things.
how can i do that?
|
| |
|
3 Comments |
|
|
|
|