ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [Comm] tty number in script...
@ 2004-07-13 14:47 Alexandr R Ogurtzoff
  2004-07-13 15:52 ` Yuri N. Glibovetz
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alexandr R Ogurtzoff @ 2004-07-13 14:47 UTC (permalink / raw)
  To: community

Вопрос как мне узнать на какой консоли запущен скрипт?
То есть допустим я в приглашении командной строки хочу видеть на какой по 
номеру консоли я нахожусь tty1-6 ?
-- 
С наилучшими пожеланиями
With best regards
Александр Огурцов
Alexandr Ogurtzoff


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Comm] tty number in script...
  2004-07-13 14:47 [Comm] tty number in script Alexandr R Ogurtzoff
@ 2004-07-13 15:52 ` Yuri N. Glibovetz
  2004-07-13 16:06 ` Alex Yustasov
  2004-07-14  6:09 ` Alexandr R Ogurtzoff
  2 siblings, 0 replies; 6+ messages in thread
From: Yuri N. Glibovetz @ 2004-07-13 15:52 UTC (permalink / raw)
  To: community


Alexandr R Ogurtzoff пишет:

> Вопрос как мне узнать на какой консоли запущен скрипт?
> То есть допустим я в приглашении командной строки хочу видеть на какой по 
> номеру консоли я нахожусь tty1-6 ?

`tty` не подходит?


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Comm] tty number in script...
  2004-07-13 14:47 [Comm] tty number in script Alexandr R Ogurtzoff
  2004-07-13 15:52 ` Yuri N. Glibovetz
@ 2004-07-13 16:06 ` Alex Yustasov
  2004-07-14  6:09 ` Alexandr R Ogurtzoff
  2 siblings, 0 replies; 6+ messages in thread
From: Alex Yustasov @ 2004-07-13 16:06 UTC (permalink / raw)
  To: community

On Tue, Jul 13, 2004 at 05:47:34PM +0300, Alexandr R Ogurtzoff wrote:
> Вопрос как мне узнать на какой консоли запущен скрипт?
> То есть допустим я в приглашении командной строки хочу видеть на какой по 
> номеру консоли я нахожусь tty1-6 ?
fgconsole?



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Comm] tty number in script...
  2004-07-13 14:47 [Comm] tty number in script Alexandr R Ogurtzoff
  2004-07-13 15:52 ` Yuri N. Glibovetz
  2004-07-13 16:06 ` Alex Yustasov
@ 2004-07-14  6:09 ` Alexandr R Ogurtzoff
  2004-07-14  6:24   ` Alexey I. Froloff
  2 siblings, 1 reply; 6+ messages in thread
From: Alexandr R Ogurtzoff @ 2004-07-14  6:09 UTC (permalink / raw)
  To: community

В сообщении от Вторник 13 Июль 2004 17:47 Alexandr R Ogurtzoff написал(a):
> Вопрос как мне узнать на какой консоли запущен скрипт?
> То есть допустим я в приглашении командной строки хочу видеть на какой по
> номеру консоли я нахожусь tty1-6 ?
 Спасибо получилось!

 [iscander@iscander /dev/pts/2 ~]$ PS1="[\u@\h `tty` \w]\$ "
[iscander@iscander /dev/pts/2 ~]$ PS1="[\u@\h `fgconsole` \w]\$ "
[iscander@iscander 7 ~]$
--
С наилучшими пожеланиями
With best regards
Александр Огурцов
Alexandr Ogurtzoff


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Comm] tty number in script...
  2004-07-14  6:09 ` Alexandr R Ogurtzoff
@ 2004-07-14  6:24   ` Alexey I. Froloff
  2004-07-14  7:03     ` Alexandr R Ogurtzoff
  0 siblings, 1 reply; 6+ messages in thread
From: Alexey I. Froloff @ 2004-07-14  6:24 UTC (permalink / raw)
  To: ALT Linux Community

[-- Attachment #1: Type: text/plain, Size: 863 bytes --]

* Alexandr R Ogurtzoff <iscander@> [040714 10:14]:
> > Вопрос как мне узнать на какой консоли запущен скрипт?
> > То есть допустим я в приглашении командной строки хочу видеть на какой по
> > номеру консоли я нахожусь tty1-6 ?
>  Спасибо получилось!
>  [iscander@iscander /dev/pts/2 ~]$ PS1="[\u@\h `tty` \w]\$ "
> [iscander@iscander /dev/pts/2 ~]$ PS1="[\u@\h `fgconsole` \w]\$ "
> [iscander@iscander 7 ~]$
А man `basename $SHELL` читать не пробовали?

bash:
              \l     the basename of the shell's terminal device name

zsh:
       %l     The line (tty) the user is logged in on, without `/dev/' prefix.
              If the name starts with `/dev/tty', that prefix is stripped.

-- 
Regards, Sir Raorn.
-------------------
[...] собираемость sandman'ом гарантирует собираемость hasher'ом
не менее чем на 90%.
		-- ldv in devel@

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Comm] tty number in script...
  2004-07-14  6:24   ` Alexey I. Froloff
@ 2004-07-14  7:03     ` Alexandr R Ogurtzoff
  0 siblings, 0 replies; 6+ messages in thread
From: Alexandr R Ogurtzoff @ 2004-07-14  7:03 UTC (permalink / raw)
  To: ALT Linux Community


> А man `basename $SHELL` читать не пробовали?
>
> bash:
>               \l     the basename of the shell's terminal device name
>
> zsh:
>        %l     The line (tty) the user is logged in on, without `/dev/'
> prefix. If the name starts with `/dev/tty', that prefix is stripped.
 Пробовал! получалось :-)

PS1="[\u@\h `tty` \w]\$ "
[iscander@iscander /dev/pts/2 ~]$ PS1="[\u@\h `fgconsole` \w]\$ "
[iscander@iscander 7 ~]$ PS1="[\u@\h \l \w]\$ "
[iscander@iscander 2 ~]$
с tty наиболее полный вывод получается,на мой взгляд более  "политкорректный"!
Всёж таки различает псевдотерминал и реальную консоль, но за ещё одно зёрнышко 
опыта спасибо.
--
С наилучшими пожеланиями
With best regards
Александр Огурцов
Alexandr Ogurtzoff


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-07-14  7:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-13 14:47 [Comm] tty number in script Alexandr R Ogurtzoff
2004-07-13 15:52 ` Yuri N. Glibovetz
2004-07-13 16:06 ` Alex Yustasov
2004-07-14  6:09 ` Alexandr R Ogurtzoff
2004-07-14  6:24   ` Alexey I. Froloff
2004-07-14  7:03     ` Alexandr R Ogurtzoff

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git