shell echo help needed


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting shell echo help needed
# 1  
Old 08-09-2010
shell echo help needed

Code:
echo '#!/usr/local/bin/expect' > sree_expt
echo "spawn passwd $User" >> sree_expt
echo 'expect "New password:"' >> sree_expt
echo send "$Password\r" >> sree_expt
echo 'expect "Re-enter new password:"' >> sree_expt
echo send "$Password\r" >> sree_expt
echo "expect eof" >> sree_expt

for this sree_expt output is
Code:
#!/usr/local/bin/expect' 
spawn passwd "given value"
'expect "New password:"
send given_password^M is comming insted of send given_password\r

how to print send given_password\r by echo please help
if any other shell also ok please help i need it very urgent............................Smilie

Moderator's Comments:
Mod Comment Double post. Continue here

Last edited by Scott; 08-09-2010 at 04:23 AM.. Reason: code tags, please...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

problem in exit in same shell with echo

Hello All, I am in SunOS usvh3eudv80 5.10. facing problem in my script: #!/bin/bash var1=`date +"%m%d%H%M"%S.zip` echo " Hi your current dir is :---> $(pwd)";echo " Changing to home dir:" cd ~ 2>/dev/null || {echo "Change dir failed ....Quiting...." && exit 2 }; ls -lrt echo... (3 Replies)
Discussion started by: krsnadasa
3 Replies

2. Shell Programming and Scripting

Shell Script if $2 is greater than 10 then echo $1

Hi, I have a file output.txt 3258 14 32647 10 32649 10 32650 10 32651 10 32652 10 32653 10 32654 10 32655 10 32656 10 32515 09 32478 08 32555 08 35888 08 (4 Replies)
Discussion started by: amit_spl
4 Replies

3. Shell Programming and Scripting

echo prints nothing-shell script

could anyone tell me why when i execute the following script, echo returns blank set k = 1 echo $k (9 Replies)
Discussion started by: saman_glorious
9 Replies

4. Shell Programming and Scripting

echo in alias for Unix C-Shell Prompt

Hi, I want to set Unix prompt in C-Shell which required the break new line using alias. Ex. hostname : username : %> Now, it will be setup in .login file with alias alias cd 'cd \!* | set prompt="`hostname` : $USER : %>"' I'm unable to parse echo command or break which I can get %>... (3 Replies)
Discussion started by: buzzusa
3 Replies

5. Solaris

Confused with echo $SHELL Command....

Hi.. Everyone... Kindly consider following : login as: root Using keyboard-interactive authentication. Password: Last login: Mon Nov 3 19:30:50 2008 from xxxxxxxxxxx Sun Microsystems Inc. SunOS 5.10 Generic January 2005 You have new mail. Sourcing //.profile-EIS..... # # ... (3 Replies)
Discussion started by: Reboot
3 Replies

6. Shell Programming and Scripting

Shell and echo

Probably my first post, very new to shell scripting :) Here is the script i am trying to modify to use function # Script to create simple menus and take action according to that selected # menu item # while : do clear echo "-------------------------------------" echo "... (2 Replies)
Discussion started by: replyramdas
2 Replies

7. UNIX for Advanced & Expert Users

Echo with ksh shell

Hi All, I'm trying to use the "echo" command in a korn shell script, and I want it to drop the trailing newline. Now I know that with the bash shell, the "-n" flag would solve this issue. Does anyone know how this can be done with the korn shell? Cheers Khoom (10 Replies)
Discussion started by: Khoomfire
10 Replies

8. UNIX for Advanced & Expert Users

run a shell script with echo

I need to schedule a shell script that runs at the command prompt to run with crontab. When I run this at the command prompt as follows it works: echo /usr/test/script.sh date1 date2 y | at 20:00 But if I will pass these argument (date1, date2, Y) with in a shell script (say scr1.sh) and... (7 Replies)
Discussion started by: keerthi
7 Replies

9. Shell Programming and Scripting

Echo escaped \c in SH Shell Any Idea

Hi All, I have got an echo statement with "\c" in it to avoid getting into a newline. Ths script is using #!\bin\sh Any idea what could make it to escape "\c" (4 Replies)
Discussion started by: asami
4 Replies

10. UNIX for Dummies Questions & Answers

echo $SHELL, $PWD and etc.

hi, this echo $SHELL will give the shell name.. how to get the other list of variables (besides SHELL) values? and also, different shells have different variable names (example SHELL) (10 Replies)
Discussion started by: yls177
10 Replies
Login or Register to Ask a Question