Need help with some questions i got on a test!


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Need help with some questions i got on a test!
# 1  
Old 01-15-2012
Need help with some questions i got on a test!

I had a test 2 weeks ago, and i got these questions that i really need help with. I cant remember exactly how they were, but i will write as much as i can and i hope you guys understand.

1. Create a file in ~/scripts/ that lists all of the filenames in the
folder /tmp that start with a n or b. The file you create should be named list.txt
First of all, how do i get to ~/scripts/? And why cant i go to /tmp by typing cd /tmp, it says something like no such directory exists?

2. Rename the file Merry&Christmas to Merry Christmas
in the home directory of the user, there was a file named Merry&Christmas, so i just had to rename it to Merry Christmas, so i wrote = mv Merry&Christmas Merry Christmas. It didnt work, why?

3. Create a new user hum with password hum.
In the home directory of the user hum, create a file named fil_1.txt owned by user hum?


4. Create a bash script called script1 in the home directory. This script should verify that the first command line argument is a name of an existing directory. If it is not, the script should exit with an error message. Otherwise, it should start the command “tar -czf /tmp/bak.tgz X”, where X is that directory.
What?

5. Run the script script1 as a background task, giving “/usr” as an argument. After the script is done, make sure it worked!



I hope you guys can help me with this, there is more questions i didnt know but i cant really remember them (DAMN!) I will edit if i remember them later on. But one thing though i wonder, how do i go to another directory/folder if the cd <directory> doesnt work? Its weird, at home, i manage to complete almost all practice questions. At test, these commands doesnt work : /
 
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shc : trying to test functionality "test" compiling but can not execute

I am testing shc to see if it would help with my need. Im at a point where Im trying to compile and test the "test.ksh" file that comes in the tar ball : shc-3.8.9> shc -v -r -f test.ksh shc shll=ksh shc =-c shc =exec '%s' "$@" shc = shc opts= shc: cc test.ksh.x.c -o test.ksh.x... (7 Replies)
Discussion started by: popeye
7 Replies

2. Shell Programming and Scripting

Prefixing test case methods with letter 'test'

Hi, I have a Python unit test cases source code file which contains more than a hundred test case methods. In that, some of the test case methods already have prefix 'test' where as some of them do not have. Now, I need to add the string 'test' (case-sensitive) as a prefix to those of the... (5 Replies)
Discussion started by: royalibrahim
5 Replies

3. AIX

Questions about DR on a Test Box?

First time doing this. What is the process? We have a vendor that takes backups of our databases and directories offsite to a windows box cifs mounted, but we dont actually make mksysb tapes. Is this the first step, to make mksysb backup? So can someone please tell me the easiest way to test a... (2 Replies)
Discussion started by: NycUnxer
2 Replies

4. Homework & Coursework Questions

Print questions from a questions folder in a sequential order

1.) I am to write scripts that will be phasetest folder in the home directory. 2.) The folder should have a set-up,phase and display files I have written a small script which i used to check for the existing users and their password. What I need help with: I have a set of questions in a... (19 Replies)
Discussion started by: moraks007
19 Replies

5. Shell Programming and Scripting

How to check weather a string is like test* or test* ot *test* in if condition

How to check weather a string is like test* or test* ot *test* in if condition (5 Replies)
Discussion started by: johnjerome
5 Replies

6. Shell Programming and Scripting

Test on string containing spacewhile test 1 -eq 1 do read a $a if test $a = quitC then break fi d

This is the code: while test 1 -eq 1 do read a $a if test $a = stop then break fi done I read a command on every loop an execute it. I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test. For example echo hello. Now the... (1 Reply)
Discussion started by: Max89
1 Replies
Login or Register to Ask a Question