Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to correctly use an echo inside an echo? Post 302351989 by mokachoka on Thursday 10th of September 2009 06:40:39 AM
Old 09-10-2009
How to correctly use an echo inside an echo?

Bit of a weird one i suppose, i want to use an echo inside an echo... For example...

i have a script that i want to use to take users input and create another script. Inside this script it creates it also needs to use echos...

echo "echo "hello"" >$file
echo "echo "goodbye"" >$file

Why is this not correct?

Thanks.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

echo not echoing correctly

Here is the file named tuwork.......... 209 200 WZ 6529 SKTNCA01X4X C POI LODI LODI 738 SKTNCA0127T LOD Here is the scipt....... cat tuwork | while read rva do num=`echo $rva | cut -d" " -f1-2` reg=`echo $rva | cut -c10` ocn=`echo $rva | cut -c12-15` x=`echo $rva | cut -c29`... (3 Replies)
Discussion started by: shorty
3 Replies

2. Shell Programming and Scripting

Difference between using "echo" builtin and /bin/echo

So in my shell i execute: { while true; do echo string; sleep 1; done } | read line This waits one second and returns. But { while true; do /bin/echo string; sleep 1; done } | read line continues to run, and doesn't stop until i kill it explicitly. I have tried this in bash as well as zsh,... (2 Replies)
Discussion started by: ulidtko
2 Replies

3. Shell Programming and Scripting

With that logic this echoes "echo". Question about echo!

echo `echo ` doesn't echoes anything. And it's logic. But echo `echo `echo ` ` does echoes "echo". What's the logic of it? the `echo `echo ` inside of the whole (first) echo, echoes nothing, so the first echo have to echo nothing but echoes "echo" (too much echoing :P):o (2 Replies)
Discussion started by: hakermania
2 Replies

4. Shell Programming and Scripting

Preserve extented ascii character when run echo comand inside bash script

Hi everyone, I'm echo some text with extended ascii characters as below: echo -e "Pr\xE9sentation du spectacle" > output or echo -e "Présentation du spectacle" > outputIf I open the file created I see this text Présentation du spectacleThe text is shown correctly in this created file when... (7 Replies)
Discussion started by: Ophiuchus
7 Replies

5. Shell Programming and Scripting

perform echo and awk inside a string

hi, just wanted to make a shortcut of this one a="a b c" b=`echo $a | awk '{print $2}'` echo "the middle is $b" why can't i do this: a="a b c" echo "the middle is ${`echo $a | awk '{print $2}'`}" <- bad substitution :wall: thanks (6 Replies)
Discussion started by: h0ujun
6 Replies

6. 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

7. Shell Programming and Scripting

Unable to echo single quotes inside awk

# echo 'export HISTFILE=/var/log/history/history_$(uname -n)_$(date +%Y:%b:%d:%H:%M)_$(who am i | awk '{print \$1}')' >> new_file # # cat new_file export HISTFILE=/var/log/history/history_$(uname -n)_$(date +%Y:%b:%d:%H:%M)_$(who am i | awk {print $1}) # Now how to echo the quotes around the... (2 Replies)
Discussion started by: proactiveaditya
2 Replies

8. Shell Programming and Scripting

Using echo to print arguments inside a function

I am using echo in bash. Have created a function prargv which takes a number of arguments. Example: prargv "-e" "--examples" Inside prargv, I want to print all the arguments using echo echo "$@" This returns --examples rather than -e --examples" This problem can be fixed... (3 Replies)
Discussion started by: kristinu
3 Replies

9. UNIX for Dummies Questions & Answers

Difference between echo `ls -l` and echo "`ls -l`" ?

Hi guys, Been messing around with shell programming for a couple of days and I found something that was pretty odd in the behavior of the echo command. Below is an example-: When I type the following in my /home directory from my lxterminal in Debian-: echo "`ls -l`" I get the... (2 Replies)
Discussion started by: sreyan32
2 Replies

10. Shell Programming and Scripting

Less or echo

Is there a better way to show the results of a file on the screen other then less , which exits the program and displays: Input Status AB026906.1:c.274G>T OK c:/Users/cmccabe/Desktop/Python27/syntax_verify.txt (END) authenticate() { printf "\n\n" less... (4 Replies)
Discussion started by: cmccabe
4 Replies
SSH2_METHODS_NEGOTIATED(3)						 1						SSH2_METHODS_NEGOTIATED(3)

ssh2_methods_negotiated - Return list of negotiated methods

SYNOPSIS
array ssh2_methods_negotiated (resource $session) DESCRIPTION
Returns list of negotiated methods. PARAMETERS
o $session - An SSH connection link identifier, obtained from a call to ssh2_connect(3). RETURN VALUES
EXAMPLES
Example #1 Determining what methods were negotiated <?php $connection = ssh2_connect('shell.example.com', 22); $methods = ssh2_methods_negotiated($connection); echo "Encryption keys were negotiated using: {$methods['kex']} "; echo "Server identified using an {$methods['hostkey']} with "; echo "fingerprint: " . ssh2_fingerprint($connection) . " "; echo "Client to Server packets will use methods: "; echo " Crypt: {$methods['client_to_server']['crypt']} "; echo " Comp: {$methods['client_to_server']['comp']} "; echo " MAC: {$methods['client_to_server']['mac']} "; echo "Server to Client packets will use methods: "; echo " Crypt: {$methods['server_to_client']['crypt']} "; echo " Comp: {$methods['server_to_client']['comp']} "; echo " MAC: {$methods['server_to_client']['mac']} "; ?> SEE ALSO
ssh2_connect(3). PHP Documentation Group SSH2_METHODS_NEGOTIATED(3)
All times are GMT -4. The time now is 02:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy