Prompt home made script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Prompt home made script
# 1  
Old 05-13-2011
Prompt home made script

Hi

I made a script called mydf which puts out the amount of storage space left on the file system;
df | head -2 | tail -1 | tr -s " " | cut -d" " -f4
But I would like to run it with every new prompt, so you get something like; user@5518748~$ in your prompt (5518748 being the mydf output). Its already in the ~/bin folder so can be executed anywhere without ./

I couldn't find anything on the web on this so I wonder if it's possible, and how to do this.
Can someone help me out with this?

Regards
# 2  
Old 05-13-2011
Code:
Fri May 13 15:39:31 MYT 2011 $ PS1='${LOGNAME}@$(date) $ '
cgi@Fri May 13 15:39:44 MYT 2011 $
cgi@Fri May 13 15:39:45 MYT 2011 $
cgi@Fri May 13 15:39:45 MYT 2011 $

I think same should work for you using mydf instead of date.
# 3  
Old 05-13-2011
Yep, got it working.

Thanks.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

[Tip] Housekeeping Tasks Made Easy - User Home directories and Leftover Files

We have regularly questions about how to create users and user accounts. But regularly user accounts need to be deleted too. It is quite easy to delete the user account itself but usually the HOME directory of the user remains. It is good style to remove these directories but simply deleting... (3 Replies)
Discussion started by: bakunin
3 Replies

2. Shell Programming and Scripting

Pls help with script made a calculator

Hello, I'm in need with a little help for my script please this is the brief i need to complete which I haven't been able to do: On option 7 stop the calculator The calculator will keep running until option 7 is chosen. Any other option than 1-7 will generate an error message. Pls any help... (1 Reply)
Discussion started by: linuxepicuser
1 Replies

3. Solaris

Unable to move from rsc prompt to ok prompt

Hi, on sunfire v890 unable to move from rsc prompt to ok prompt, i have executed the command break. (9 Replies)
Discussion started by: manoj.solaris
9 Replies

4. Shell Programming and Scripting

how to run an already made script run against a list of ip addresses solaris 8 question

how to run an already developed script run against a list of ip addresses solaris 8 question. the script goes away and check traffic information, for example check_GE-VLANStats-P3 1.1.1.1 and returns the results ok. how do I run this against an ip list? i.e a list of 30 ip addresses (26 Replies)
Discussion started by: llcooljatt
26 Replies

5. Shell Programming and Scripting

Script to send alert if any changes are made in crontab.

Hi i want to know how can i write a script to check if any changes are made and send an alert in crontabs . i am using .ksh file extension for writing scripts. (3 Replies)
Discussion started by: honey26
3 Replies

6. Shell Programming and Scripting

Improve script made to calculate value based on present and previous line

Hi all, I have made at small script to make a simple calculation on a file which is formatted in this way: I want to create a new file in which the value of particular line minus the previous line is printed. So my wanted output is: I have made the following program to do the job... (5 Replies)
Discussion started by: s052866
5 Replies

7. Linux

Lock User in home directory in ftp prompt

Hi, I am using Red Hat Enterprise Linux ES release 4 (Nahant Update 5). Here I have created one user with /sbin/nologin shll such that login is not possible only ftp is possible. But I want to do another thing that the user can not roam around after ftp. I had tried one way. in... (4 Replies)
Discussion started by: kallol
4 Replies

8. Solaris

scp prompt when home directory is 777

Morning all, I was running some deployment scripts on Friday night that kept failing because it prompted for a password for a user I was already sudo'd in as when trying to scp a file onto itself. e.g. on server 51.123.123.123 as sudo dlam typing: scp testfile dlam@51.123.123.123:/tmp ... (5 Replies)
Discussion started by: dlam
5 Replies

9. Shell Programming and Scripting

How do I assign values to variables made in a script?

How do I assign values to variables made in a script? e.g. for ((x=0;x<=5;i+=1)); do Xm$i=$var done (0 Replies)
Discussion started by: gelitini
0 Replies

10. UNIX for Dummies Questions & Answers

Made command into a script but now won't run

Hello, After seeing in a Unix cheatsheet that I could add commands into a file and run that file as a command to save on typing, i tried it with this: #! /bin/csh # Backup website excluding directories that do not change rsync -e "ssh -p 2222" -axzvc --progress --stats --compress-level=9... (9 Replies)
Discussion started by: patwa
9 Replies
Login or Register to Ask a Question