set variable to Home, then echo it to screen


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers set variable to Home, then echo it to screen
# 1  
Old 02-23-2006
set variable to Home, then echo it to screen

Major Newbie here folks. I'm trying to set a variable to my Home directory and then echo it to the screen.
Any and all help is greatly appreciated.
Thanks
Anna
# 2  
Old 02-23-2006
You should have a variable already set called HOME. Try:
echo $HOME
# 3  
Old 02-23-2006
Home work questions are not allowed in this site.Please post ONLY real problems.
Assuming it is NOT homework question,

Code:
echo $HOME
a=$HOME
echo $a

# 4  
Old 02-23-2006
variable

I have looked through all data, posts, documentation etc on how to do this. And yes, since you ask it is a homework question. What do you mean, "Real problem"? Isn't this a place to search for help? EXCUSE ME, bargav, for asking. I'm sure you were BORN all knowing and have all the answers.......AND by the way, your reply DID NOT WORK.

Don't bother responding because I certainly will not ever post to this forum again.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

How to set variable for users with no home directory?

Hi I need to set $HISTFILE for a user with no home directory. How to go about it because this user does not have a .profilefile. (5 Replies)
Discussion started by: fretagi
5 Replies

2. Shell Programming and Scripting

Echo both to the screen and to a file

In shellscript, I want to display echo message in console and in the log file. please help me to display this message in two places. I am using below statment to display messsage, but it is displaying in log file only. echo "Server Already running" >> serverlog 2>&1 (3 Replies)
Discussion started by: Kri
3 Replies

3. Shell Programming and Scripting

echo command with screen and ssh

Hi, i need to execute echo command to write in a txt file on a remote machine. i did it in this way: ssh user@remotemachine "echo "put text here" > /home/user/myfile.txt" I tried to run the same command within a detached screen in this way: ssh user@remotemachine screen -dm "echo "put... (3 Replies)
Discussion started by: brembo
3 Replies

4. Shell Programming and Scripting

echo 2 txt files to screen no carraige return

I have two text files, each of then only containing ONE line and NO carraige return or white space at the end...how do I echo both of these text files to the screen without putting an extra line? I want to do this from the command line. file1.txt: this is file1.txt 1 file2.txt: this is... (4 Replies)
Discussion started by: ajp7701
4 Replies

5. UNIX for Dummies Questions & Answers

echo $PATH doesn't match $HOME/.profile

This is on a Solaris 9 box, but I feel like a noob, so I am posting here. When I echo $PATH I get a lot of duplicate paths and extra stuff I don't need. What I want is just what I set up in my home dir under .profile My login shell=/bin/bash I checked the following and there are no path... (1 Reply)
Discussion started by: Veestan
1 Replies

6. Shell Programming and Scripting

echo to both screen and a file

Please help me to simplify my below script. #!/bin/bash LOG_FILE=/tmp/log.txt echo "Hello" echo "Hello" >> /tmp/log.txt Is there anyway, that I can echo "Hello" to both screen and file with one single echo command ? (6 Replies)
Discussion started by: phamp008
6 Replies

7. UNIX for Dummies Questions & Answers

how to set $HOME?

Hi Everyone! I just want to know how to set $HOME. I cant see $HOME in my profile. Below is my profile. export PATH=.:/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:/mai lservice/sybase/12.5/OCS-12_5/bin:/mailservice/sybase/config:. #export $PATH export... (2 Replies)
Discussion started by: sachin.gangadha
2 Replies

8. Shell Programming and Scripting

How to set echo on

I'm looking at my bash man page and I'm expecting to find some option that I can use to make it echo every command that it executes. The description of --verbose was pretty terse! Is --verbose supposed to make it echo every command it executes? My bash script script (named ws2) contains a... (1 Reply)
Discussion started by: siegfried
1 Replies

9. UNIX for Dummies Questions & Answers

is it possible to echo 'some text' every 10 minutes on my screen

is it possible to echo 'some text' every 10 minutes on my screen continues , without cron. (1 Reply)
Discussion started by: vkandati
1 Replies

10. UNIX for Dummies Questions & Answers

echo or print to screen and file

I did a search for this topic but I couldn't find it and I was sure I have seen something similar before (hard because I am not sure of the criteria for the keywords) What I was looking for was to be able to echo a message to the screen from a bash.sh script at the same time logging it to a... (2 Replies)
Discussion started by: Shakey21
2 Replies
Login or Register to Ask a Question