LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   konsole won't set variables (https://www.linuxquestions.org/questions/linux-newbie-8/konsole-wont-set-variables-4175425774/)

sbgirl54 09-05-2012 09:02 AM

konsole won't set variables
 
Hey guys,

I'm not sure if this is a real problem or I just don't know what I'm doing. I'm trying to set a string variable in the shell. (I'm under SUSE)

I'm doing this:


seib@linux-fhrs:~> set name = some_name
seib@linux-fhrs:~> echo $name

seib@linux-fhrs:~> $?name
If '0name' is not typo you can use command-not-found to lookup the package that contains it, like this:
cnf 0name
seib@linux-fhrs:~>


I also looked in $ env and 'name' wasn't in the list. What am I doing wrong?

Also, how do you copy text from the konsole?

pan64 09-05-2012 09:08 AM

this syntax is valid for tcsh. Probably you are using bash, execute echo $0 to check it.

sbgirl54 09-05-2012 11:22 AM

Yes, I am executing bash.

seib@linux-fhrs:~> echo $0
/bin/bash
seib@linux-fhrs:~>

That's why all my scripts start with #!/bin/bash .

Is it possible to set variables in bash, and what is the appropriate syntax?

sbgirl54 09-05-2012 11:33 AM

Ha, I went googling and solved my problem. Thanks anyway (:

chrism01 09-05-2012 07:48 PM

Good bash links
http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/

Kallaste 09-05-2012 09:36 PM

Quote:

Originally Posted by sbgirl54 (Post 4773281)
Hey guys,

Also, how do you copy text from the konsole?

It depends on environment and configuration, but a standard way of copying and pasting is to just highlight the text (which copies it automatically), move your mouse to where you want to put it, and press the middle mouse button (or both mouse buttons simultaneously if don't have a middle one). You can also highlight the text (copying it), then press shift + insert to paste it. Or you can try ctrl-k and ctrl-u.


All times are GMT -5. The time now is 12:24 AM.