Re: How to find your shell

2005-05-01 Thread Terje Eggestad




if you're looking for the login shell (or the users default shell) use getpwent(), don't check the /etc/passwd directly. 

TJ


On Fri, 2005-04-22 at 06:45 -0700, Shiraz Baig wrote:


There are two three methods.
One is to check the environments. In that one item
will be the shell.

Second is to cat /etc/passwd and see the shell that
has been allotted to you. 

The third is run a command, which does not exist. For
example abc. it will give an error and also the name
of the shell.
bye
shiraz

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list






-- 

Terje Eggestad
Senior Software Engineer
dir. +47 22 62 89 61
mob. +47 975 31 57
fax. +47 22 62 89 51
[EMAIL PROTECTED]

Scali - www.scali.com
High Performance Clustering






___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


textview vs textbuffer

2004-03-19 Thread Terje Eggestad




I'm curious about one thing, tags are applied per textbuffer (which make sense to me) but changes to the defaults are done per textview, which to don't make sense, the same buffer is connected to two views can have different appearances...

Is this deliberate?





-- 
Terje Eggestad [EMAIL PROTECTED]








Re: Scroll to the end of a TextView

2004-03-04 Thread Terje Eggestad
It wasn't intuitive, but scroll to mark doe the trick, the following
func append to a textview (a log actually) and scrolls:

void scacpg_append_runlog(char * msg, ...)
{
   GtkTextView * eview;
   GtkTextBuffer * ebuf;
   GtkTextIter start, end;
   va_list ap;
   char * buffer = NULL;
   int l, L = 128;
   GtkTextMark* mark;

   va_start(ap, msg);

   do {
  L *= 2;
  debug(realloc of log buffer to size %d, L);
  buffer = realloc(buffer, L);
  l = vsnprintf(buffer, L, msg, ap);
  if (l  0) return;
   } while (l = L);

   eview = (GtkTextView* ) lookup_widget(dialog_run,
textview_cpg_output);
   ebuf = gtk_text_view_get_buffer (eview);

   debug (runlog: %s(%d), buffer, l);
   gtk_text_buffer_get_bounds (ebuf, start, end);
   gtk_text_buffer_insert  (ebuf, end, buffer, l);
   gtk_text_buffer_get_bounds (ebuf, start, end);


   mark = gtk_text_buffer_create_mark(ebuf, NULL, end, 1);
   gtk_text_view_scroll_to_mark(eview, mark, 0.0, 0, 0.0, 1.0);
   gtk_text_buffer_delete_mark (ebuf, mark);


   free(buffer);
   va_end(ap);

};


On Thu, 2004-03-04 at 20:45, Felipe Weckx wrote:
 Hi everyone,
 
 Here's the deal: the program receives a string and show it on a TextView 
 , that's OK, but I have to scroll the view to end of the text, I tried 
 using gtk_text_buffer_get_end_iter and gtk_text_view_scroll_to_iter, but 
   it only scrolls to beginning of the text I've just inserted, so if it 
 has more than one line, it doesn't scrolls to the end.
 
 Does anyone knows how to scroll to the end of the text?
-- 
Terje Eggestad [EMAIL PROTECTED]

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list