Bourne Shell Script that only takes command line arguments


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Bourne Shell Script that only takes command line arguments
# 1  
Old 03-25-2010
Question Bourne Shell Script that only takes command line arguments

Does anybody know how to Accept a “userid” as a command line argument on a Unix Bourne Shell Script?

The output should be something like this:

User userid has a home directory of /path/directory
the default shell for this user is /path/shell
# 2  
Old 03-25-2010
Is this homework? Because a "different" user, just an hour ago, posted homework using the very same IP as you just did, and your "requirement" seems equally homework-like.
# 3  
Old 03-25-2010
Homework?!
Nope Mr. Moderator, I reckon I'm too old to do homeworks at this age :-)
# 4  
Old 03-25-2010
What did you try so far?
# 5  
Old 03-25-2010
Quote:
Originally Posted by ajaira
Homework?!
Nope Mr. Moderator, I reckon I'm too old to do homeworks at this age :-)
Well I wouldn't know since I don't see your birth date anywhere.

Also, if you're old enough to be past homework, one would reckon you're old enough to be able to read, too, and apply that ability to our rules. Because there it states
Quote:
(4) Do not 'bump up' questions if they are not answered promptly. No duplicate or cross-posting and do not report a post or send a private message where your goal is to get an answer more quickly.
# 6  
Old 03-25-2010
Are you logged in as the user in question?
If so this is a clue:
echo "${SHELL}"
echo "${HOME}"

Do you have legitimate "root" access to the server which would give you sufficient privilege to enquire on other users?
What Operating System do you have?
Are you really using a pure Bourne Shell? This is quite difficult to achieve in modern unix systems. Is this a very old computer?


Ps. Please don't post the same question in multiple places.

Last edited by methyl; 03-25-2010 at 06:18 PM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parsing Command Line Arguments In C shell script

]I have a string like "/abc/cmind/def/pq/IC.2.4.6_main.64b/lnx86" and this string is given by user. But in this string instead of 64b user may passed 32 b an i need to parse this string and check wether its is 32b or 64 b and according to it i want to set appropriate flags. How will i do this... (11 Replies)
Discussion started by: codecatcher
11 Replies

2. UNIX for Dummies Questions & Answers

Script to iterate all command line arguments

Hi guys, I am having trouble with this script. What i want it to do is to iterate all command line arguments in reverse order. The code below does this fine but i need the output to print the words on separate lines instead of one line: #!/bin/bash #Takes in the arguments and displays them... (7 Replies)
Discussion started by: pipeline2012
7 Replies

3. Programming

How to pass the command line arguments to the shell script in c language?

hi, I am new in the shell script, and c programming with linux. I am looking to pass the arguments in c program that should be executed by the shell script. e.g. #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv) { int i; for (i=1;i<argc; i++) { ... (2 Replies)
Discussion started by: sharlin
2 Replies

4. Shell Programming and Scripting

bourne shell script error on line containing declare...

Hi, Get the following error when running a shell script with following statement. Syntax error at line 150 : `(' is not expected 150: declare -a VPO_SEV=(Normal Warning Minor Major Critical) it runs fine using bash, so I guess the script should be using bash but is there a... (1 Reply)
Discussion started by: wilsonee
1 Replies

5. Shell Programming and Scripting

How to use case and command line arguments in shell script?

Hi... can anyone please help me out in using the CASE and command line argument in shell script... i am bit new to shell scripting...below i have explained my proble with example... say i have an executable file with name 'new1.sh' and there are 3 functions in it a(), b() and c()....and there... (5 Replies)
Discussion started by: swap21783
5 Replies

6. Shell Programming and Scripting

Shell script command line arguments

Hello All, i am known to the limitation of different shells while passing more than 9 command line arguments i just tried the example below i do see my current shell is tcsh echo $SHELL /bin/tcsh so if i make my script executable and run it output is ... (6 Replies)
Discussion started by: Deepak Dutt
6 Replies

7. UNIX for Advanced & Expert Users

Bourne Shell Script that only takes command line arguments

Does anybody know how to Accept a “userid” as a command line argument on a Unix Bourne Shell Script? The output should be something like this: User userid has a home directory of /path/directory the default shell for this user is /path/shell (1 Reply)
Discussion started by: ajaira
1 Replies

8. Shell Programming and Scripting

Bourne Shell Script that only takes command line arguments

Does anybody know how to Accept a “userid” as a command line argument on a Unix Bourne Shell Script? The output should be something like this: User userid has a home directory of /path/directory the default shell for this user is /path/shell (1 Reply)
Discussion started by: ajaira
1 Replies

9. Shell Programming and Scripting

To Write a Shell script that takes two arguments.

How to write a shell script tht takes two arguments.The first being a line of text,the second being your newly created file(x no:of lines and content of ur choice). The script should take the first argument and insert it into the very top(the first line)of the file named in your second argument.... (3 Replies)
Discussion started by: bobby36
3 Replies

10. UNIX for Dummies Questions & Answers

Write a script that takes 2 arguments

hi i would be grateful for some help on the following q. "Write a script that takes two arguments. The first being a line of text, the second being your newly created file. The script should take the first argument and insert it into the very top ( the first line) of the file named in your... (6 Replies)
Discussion started by: mopimp
6 Replies
Login or Register to Ask a Question