[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

RE: Bug in my shell script



Doesn't the sed part substitute anything that ends with .sts with nothing,
and nothing ends in .sts.
Maybe if you put sed -e 's/\/home\/guests//g' --that seems to work by
itself.  You should need the echo "" | sh, because it will already run in
sh.

Forrest


> -----Original Message-----
> From: Jasper Jans [mailto:jjans@bio.vu.nl]
> Sent: Thursday, March 29, 2001 12:15 PM
> To: guinness-list@redhat.com
> Subject: Bug in my shell script
> 
> 
> Hi..
> 
> I'm trying to write a shell script but for some reason I cannot
> get it to work.. can anyone be so good to tell me what is going
> wrong here?
> 
> ---
> #!/bin/sh -x
> 
> if [ $# -eq 0 ]; then
>         echo "Usage: $0 <expression>";
>         exit;
> fi
> 
> echo "find /home/guests/jjans -type d -name '*"$1"*' -exec 
> 'sed s/*.sts//g'
> \;" | sh
> ---
> 
> I call this like: ./bla.sh roje
> And the find part (if I run that seperately) returns lines like:
> /home/guests/jjans/Projects/A
> /home/guests/jjans/Projects/B
> etc..
> 
> The sed part is support to strip of the /home/guests part and make it
> such that the output is
> /jjans/Projects/A
> /jjans/Projects/B
> etc..
> 
> However when I run this I get absolutely no output at all..
> Anyone?
> 
> Thanks,
> J.
> 
> 
> 
> _______________________________________________
> Guinness-list mailing list
> Guinness-list@redhat.com
> https://listman.redhat.com/mailman/listinfo/guinness-list
> 





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []