Find the answer to your Linux question:
Results 1 to 2 of 2
Hi guys! I need to write a bash script that will allow me to manage my "virtual network" (in reality just a bunch of directories and files). I need to ...
  1. #1
    Just Joined!
    Join Date
    Oct 2008
    Posts
    5

    Virtual accounts - changing prompt

    Hi guys!
    I need to write a bash script that will allow me to manage my "virtual network" (in reality just a bunch of directories and files).

    I need to obtain something like : I have my own command 'connect'. We can use it in two different modes: user and admin.

    If I type 'connect adashiu virtual_machine_name, computer will ask about password, if password is correct he will change a prompt to :

    adashiu_at_virtual_machine_name >

    after that user can start to use commands reserved only for user mode.

    Analogically with admin mode: prompt 'admin >' and administrator can only use bunch of commands reserved for him.

    Can anyone tell me how to solve this problem with changing prompt and separated commands for user and admin ?

    Thank you in advance and
    sorry for my english

    Adam

  2. #2
    Linux User
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    262
    Look at the shell prompt string variables (PS1, PS2, PS3, etc).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...