ksh script that echo " please insert your name " and store the output to a login.log file.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ksh script that echo " please insert your name " and store the output to a login.log file.
# 1  
Old 02-15-2010
ksh script that echo " please insert your name " and store the output to a login.log file.

Hello All
Nice to meet you all here in this forum,
it's my 1rst time here
i'm asking about a little issue that i face
i added a ksh script that echo " please insert your name " and store the output to a login.log file.
the script is working fine with normal telnet
but Xstart is not working anymore with this user account.
can any one tell me how to export this echo to Xstart ????
Best Regards

---------- Post updated at 08:15 AM ---------- Previous update was at 05:42 AM ----------

echo "Please insert your User Name "
read x
echo $x `who am i` " Success " >> /login.log

this is the script, and i added it to .profile, it is working fine with telnet but it's not working with xterm or xbrowser
any advice ????
# 2  
Old 02-15-2010
To answer your question we need to know a little more:
What is the "start not working"?
In other words, you modified a .profile but we do not know of what box... (local, distant) and how you connect (Is local a pc using X server software or a linux...)
# 3  
Old 02-15-2010
i have an IBM P5 server and users connect to this server remotely using telnet or Xstart.
i modified the .profile of the user on AIX with a script named login.sh
this script contain the following lines
echo "Please insert your User Name "
read x
echo $x `who am i` " Success " >> /login.log
it works normally with telnet
but it is not working with Xstart
i think because of display or something like that
# 4  
Old 02-15-2010
and one thing sure I wouldnt have used x for a variable name...

---------- Post updated at 14:45 ---------- Previous update was at 14:42 ----------

So you modified the .profile on that AIX box, but what do you mean by:
Quote:
i modified the .profile of the user on AIX with a script named login.sh

Last edited by vbe; 02-15-2010 at 10:01 AM..
# 5  
Old 02-15-2010
the .profile of the user account on the AIX P5
/home/user/.profile
# 6  
Old 02-15-2010
but that user when he connects is not physically on that box ,we agree? Therefore my question: Is that user using a PC with X emulation (Xserver software such as hummingbird, reflectionX etc...) in wich case I understand you startx as XDMCP session etc...
These software need to be able to send back the IP seen from your P5 then it opens a new session (the Xterminal you get displayed...) and so its also a new shell...
If you can echo, set variable etc... the fact that you put a read in blocks the good working of the .profile...
# 7  
Old 02-15-2010
yes the user is using Xserver sofware ( xmanager )
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. Shell Programming and Scripting

"echo" outputs not appear into Log file

Hi, - From Script : echo "************************************" echo "NEW_ORACLE_SID : " ${NEW_ORACLE_SID} echo "************************************" echo "" >> /auto_clone/${NEW_ORACLE_SID}/logs/clone_PERP12R.log echo... (4 Replies)
Discussion started by: htaieb1
4 Replies

3. Shell Programming and Scripting

Get "n" number of lines from the specified file and store the output to the new file

Hiii. How are you all. .. I have started to learn bash scripting.. . and I am pretty much trying to execute this script which I am still not successful.. . This is what I am trying to do. .. need to get "n" number of lines from the specified file and store the output to the new file in... (5 Replies)
Discussion started by: zsycho
5 Replies

4. Shell Programming and Scripting

tcsh - understanding difference between "echo string" and "echo string > /dev/stdout"

I came across and unexpected behavior with redirections in tcsh. I know, csh is not best for redirections, but I'd like to understand what is happening here. I have following script (called out_to_streams.csh): #!/bin/tcsh -f echo Redirected to STDOUT > /dev/stdout echo Redirected to... (2 Replies)
Discussion started by: marcink
2 Replies

5. UNIX for Dummies Questions & Answers

Why PieTTY echo login password as "*"?

Normally, When we login a remote server, the password does'nt echo as anything. But When I use PieTTY(on windows) to login a linux ssh server, the password echoes as "*". But When I have logged in, I use the ssh command to login the same server locally again, now the password does'nt echo. I... (7 Replies)
Discussion started by: vistastar
7 Replies

6. Shell Programming and Scripting

How to insert "#!/bin/bash" to output file

Hi Guys, I want to put or insert #!/bin/bash to my output file named outputfile.sh. Please need some help. inputfile.txt 1111111111 2222222222 3333333333 script: awk -f script.awk inputfile.txt > outputfile.sh DESIRED OUTPUT: (1 Reply)
Discussion started by: pinpe
1 Replies

7. Shell Programming and Scripting

store the output of "find" command in a variable?

I intend to find the path/full location of a file(filename given by user thru "read filenme") using "find" or any other command and then store it's output in a variable for some other processing. But struggling to put all things together (i.e finding the fully qualified location of that file and... (4 Replies)
Discussion started by: punitpa
4 Replies

8. Shell Programming and Scripting

"sed" to check file size & echo " " to destination file

Hi, I've modified the syslogd source to include a thread that will keep track of a timer(or a timer thread). My intention is to check the file size of /var/log/messages in every one minute & if the size is more than 128KB, do a echo " " > /var/log/messages, so that the file size will be set... (7 Replies)
Discussion started by: jockey007
7 Replies

9. HP-UX

script running with "ksh" dumping core but not with "sh"

Hi, I have small script written in korn shell. When it is called from different script, its dumping core, but no core dump when we run it standalone. And its not dumping core if we run the script using "/bin/sh" instead of "ksh" Can some body please help me how to resolve this issue. ... (9 Replies)
Discussion started by: simhe02
9 Replies

10. Shell Programming and Scripting

ksh script as a login shell return "no controlling terminal"

I have created a ksh shell script and used it as a login shell for a user. </etc/passwd> lramirev:x:111:200:Luis:/export/home/menush:/usr/local/menush/menush My shell script is like this: </usr/local/menush/menush> #!/bin/ksh # if ] then . $HOME/.profile fi ... (8 Replies)
Discussion started by: lramirev
8 Replies
Login or Register to Ask a Question