Hello,
Bash contains builtin variables that you can view by typing the env command. You can get some valuable information from that command. Such as Present /current working directory. You can use these variables to get what you are after.
Here is a snippet of the env output.
Code:
[jralph@jralph-linux ~]$ env
USER=jralph
HOME=/home/PFTCTRADING/jralph
PWD=/home/PFTCTRADING/jralph/notes
OLDPWD=/home/PFTCTRADING/jralph
In your script you can get these variables by echoing them. E.G.
Code:
[jralph@jralph-linux notes]$ echo $HOME
/home/PFTCTRADING/jralph
[jralph@jralph-linux notes]$ echo $PWD
/home/PFTCTRADING/jralph/notes
Hope this get's you started. You can post what you have so far and we can assist you.
EDIT:
Also have a look at the PS manpage. As well as the HEAD and WC man page for other requirements.
PS
UNIX man pages : ps ()
HEAD
UNIX man pages : head ()
WC
UNIX man pages : wc ()
EDIT:
Some examples of the variable echoing.
Code:
[jralph@jralph-linux notes]$ cat scripter.sh
#!/bin/bash
echo "Hello the users home directory is $HOME"
echo "The users curent directory is $PWD"
If you run it you get.
Code:
[jralph@jralph-linux notes]$ ./scripter.sh
Hello the users home directory is /home/PFTCTRADING/jralph
The users curent directory is /home/PFTCTRADING/jralph/notes
jaysunn