Results 1 to 3 of 3
hi all
mozilla -V
the output is
Mozilla 1.7.13, Copyright (c) 2003-2004 mozilla.org, build 2006050116
how to truncate this , using bash script.
i wanna out put like
mozilla-1.7.13
i ...
- 07-25-2007 #1Linux Newbie
- Join Date
- Feb 2007
- Location
- hyderabad, india
- Posts
- 247
how to truncate
hi all
the output ismozilla -V
how to truncate this , using bash script.Mozilla 1.7.13, Copyright (c) 2003-2004 mozilla.org, build 2006050116
i wanna out put like
i dont know the above command(mozilla -V) is usefull or not..mozilla-1.7.13
this folder is place in my machine path
/usr/lib
i have to get this path using bashscript.
please help me
thank you in advance"Relationships are built on trust and communication"
- 07-25-2007 #2Linux Engineer
- Join Date
- Feb 2005
- Posts
- 1,044
mozilla -V | sed -e 's/\([^,]*\),.*/\L\1/' -e 's/ /-/'
Last edited by scm; 07-25-2007 at 06:04 AM. Reason: Forgot to translate the space to a hyphen. :-(
- 07-25-2007 #3Linux Newbie
- Join Date
- Feb 2007
- Location
- hyderabad, india
- Posts
- 247
thank you very much.. it is great help
let me ask one more qury about this please.
i have to export the ".so" files to other folder..
i tried like this
it is saved as one.c and compile likeCode:#include <gtk/gtk.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char buf5[256] = {0}; char buf6[256] = {0}; FILE *fp1; fp1=popen ("rpm -ql mozilla | grep xpcom.so ", "r"); if (fp1) { fgets (buf5, sizeof (buf5), fp1); buf5[strlen(buf5) - 1] = '\0'; }//if)FD) pclose(fp1); FILE *fp2; fp2=popen ("rpm -ql mozilla | grep moz.so ", "r"); if (fp2) { fgets (buf6, sizeof (buf6), fp2); buf6[strlen(buf6) - 1] = '\0'; }//if)FD) pclose (fp2); char *s1; char *s2; s1=g_strconcat("ln -s -f ",buf5," /root/.libs/",NULL); s2=g_strconcat("ln -s -f ",buf6," /root/.libs/",NULL); FILE* F; F=popen(s1,"r"); pclose (F); FILE* F1; F1=popen(s2,"r"); pclose (F1); return 0; }
i used here a little gtk program..Code:gcc one.c -o one `pkg-config gtk+-2.0 --cflags --libs`
the output is saving file in my path sucessfully...
i think you understand my theme of the program.
i done this...
but i have convert this whole program to bash script coz , i want single line solution to check mozilla path and check mozilla version and enterd into the full path folder and link those perticulat two ".so" files to my given path( to /root/.libs).
is it possible..
please help me
thank you in advance"Relationships are built on trust and communication"


Reply With Quote
