LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-16-2003, 03:13 PM   #1
sayble96
LQ Newbie
 
Registered: Dec 2003
Location: Wisconsin
Posts: 3

Rep: Reputation: 0
Putting Script Names In Shell Scripts


Hi~

I am new here, in fact this is my first post. I am working on a shell script for class and the instructions are:

After a blank line display the text "Running the nameofscripthere shell script as user yourloginidhere"

Here's what I have so far:

echo
echo "Running the shell script as user $HOME"

What comes out is:

Running the shell script as /student/curleram

How do I get my script name in the the sentence?

Thank you so much in advance
 
Old 12-16-2003, 03:29 PM   #2
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Welcome to LQ! But part of the rules are not to ask homework related questions. I will say that you can find the answer to the first part early on in the bash manual ('man bash') and that you need to look into backticks and 'whoami' as one route to be more precise on the second part.
 
Old 12-16-2003, 05:27 PM   #3
sayble96
LQ Newbie
 
Registered: Dec 2003
Location: Wisconsin
Posts: 3

Original Poster
Rep: Reputation: 0
OOPS! Sorry, won't happen again, but thanks for the hint.
 
Old 12-17-2003, 05:57 PM   #4
dolmen
LQ Newbie
 
Registered: Dec 2003
Distribution: Mdk 9.2
Posts: 9

Rep: Reputation: 0
For "nameofscripthere" you will find the answer in the bash manual.

$HOME is not "yourloginidhere". Your techer expects "curleram" instead of "/student/curleram". Use the "env" command to show all available environment variables.
 
Old 12-17-2003, 10:16 PM   #5
sayble96
LQ Newbie
 
Registered: Dec 2003
Location: Wisconsin
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you very much. I used the $USER enviroment variable.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM
bash:output file names from shell script to vi sickboy Linux - Newbie 6 10-14-2004 03:40 AM
how to execute shell scripts from cgi script rajatgarg Linux - General 1 07-08-2004 01:39 PM
putting shell script accessible in all directory demmylls Linux - General 1 02-23-2004 10:37 AM
i need to know the names of the scripts! Jeffrey Linux - General 1 03-07-2001 09:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration