.bash files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting .bash files
# 1  
Old 11-15-2004
.bash files

i have been interacting a little with the forum in the last couple of days and to tell the truth I have learnt quite a bit from some of the posts that I have read accessed or posted.. from some of the books that I have read I have a pretty good idea about shells, profile files, .bashrc, etc, etc but little experience considering it has only been precisely one year since I started out on my unix\/linux system ( there is so much to learn its difficult to narrow down the subject of choice to one or two without missing something important somewhere else.).. any way as I said I have found the exact syntax to many of the unix subject matters outlined in books for beginners and intermediates (and beyond!) in the forum and was wandering if anyone with some expertise on the matter could give a brief description on how to use the bash files..
to be more precise..
1) how do I get aliases to work in .bashrc ( i tried to no avail!)
2) how do I go about inserting scripts into a bash login file (for ex and which file is it)..
thanx in advance moxxx68
# 2  
Old 11-15-2004
In response to question 1. A simple alias can be formed thusly
Code:
alias lla='ls -la'

within .bashrc. If you want fancy stuff, consider functions. See this thread for some information on parameters within functions.

For Q2, if you want to source other scripts at login, place a line such as
Code:
. /path/to/my/script

within .bash_login. You can do similar stuff with .bash_logout to execute commands and scripts at logout.

You can see my .kshrc file file which is the Korn shells equivalent of .bashrc and might give you some ideas.

Cheers
ZB
# 3  
Old 11-15-2004
I appreciate the info I will look at the link that you gave in greater detail it looks quite benefitial to answering most my question about the 2 example questions I gave.. I have just one more question. I just tried inserting a small login script in the .bash_profile (seems stupid) but from what your are saying there is a bash login file and its not the .bash_profile file I gather.. if not what is it called ... .bash_logout???? where can I find it..
char moxxx68
# 4  
Old 11-15-2004
You can have .profile, .bash_login or .bash_profile.

From the bash manpage
Code:
it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile,
in  that order, and reads and executes commands from the first one that
exists and is readable.

If ~/.bash_logout doesn't exist, just create it.

Cheers
ZB
# 5  
Old 11-15-2004
Computer

thanx for the update....!
this is a much needed answer since I have not been able to access the library for a while now due to a move in location.. .(my old college library)
the basic county libaries don't carry very much unix\/linux info... so I am left without the advantage I had last year. I greatly appreaciate your time..
thanx moxxx68
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script for check files

I created this script for check whether specific files exist or not in the given location. but when I run this its always showing Failed - Flag_lms_device_info_20160628.txt do not exist Failed - Flag_lms_weekly_usage_info_20160628.txt do not exist but both files are existing. appreciate help... (2 Replies)
Discussion started by: lfreez
2 Replies

2. UNIX for Dummies Questions & Answers

Bash with problems related to files

Hi unix people, i'm really a newbie and i've created a small bash to process some picture with ImageMagick. I have just some issue and i think this script, if we can help me to correct in right way, could be useful! Basically i have a Eyefi Card who puts files into a folder called "picture"... (1 Reply)
Discussion started by: riccardo
1 Replies

3. Shell Programming and Scripting

BASH Corrupts Files?

I have a system that uses file access to manage parallel processes. Each process checks to see if a file with a unique name that corresponds to the job it's got to do exists. If it does, it exits. If not, it creates one with that name. There is also a background process that is writing to this... (6 Replies)
Discussion started by: gmark99
6 Replies

4. Shell Programming and Scripting

Bash Looking into files question

I have a bunch of files that are messages in my directory. Each message has a date located in the file. How can I look into each file and find the date? Thank you for any help (7 Replies)
Discussion started by: totoro125
7 Replies

5. Shell Programming and Scripting

Renumbering files bash script

I am new to the world of Linux scripting, and would like to make the following 2 scripts: I have 67 files named Alk-0001.txt to Alk-0067.txt I would like them to be numbered Alk-002.txt to Alk-0134.txt eg Alk-0001.txt > Alk-0002.txt Alk-0002.txt > Alk-0004.txt Alk-0003.txt > Alk-0006.txt ... (3 Replies)
Discussion started by: tollyboy_uk
3 Replies

6. Shell Programming and Scripting

Bash script deleting my files, and editing files in subdirectories question

#!/bin/bash # name=$1 type=$2 number=1 for file in ./** do if then filenumber=00$number elif then filenumber=0$number fi tempname="$name""$filenumber"."$type" if (4 Replies)
Discussion started by: TheGreatGizmo
4 Replies

7. Shell Programming and Scripting

Bash: join 2 files

Hello ! I want to join 2 files. They look like this: KE340296.1 1 0/0:11 KE340296.1 2 0/0:12 KE340296.1 6 0/1:13 KE340297.1 1 0/1:14 KE340297.1 3 0/1:15 KE340297.1 4 0/1:16 and KE340296.1 1 0/0:21 KE340296.1 2 0/0:22 KE340296.1 3... (4 Replies)
Discussion started by: MumuGB
4 Replies

8. Shell Programming and Scripting

Using bash to separate files files based on parts of a filename

Hey guys, Sorry for the basic question but I have a lot of files that I want to separate into groups based on filenames which I can then cat together. Eg I have: (a_b_c.txt) WB34_2_SLA8.txt WB34_1_SLA8.txt WB34_1_DB10.txt WB34_2_DB10.txt WB34_1_SLA8.txt WB34_2_SLA8.txt 77_1_SLA8.txt... (1 Reply)
Discussion started by: Breentax
1 Replies

9. Shell Programming and Scripting

[bash] Parse files

Hi I've 2 folder A and B, they have files with the same name but different content. I mean A contain---------> aa.txt, bb.txt, cc.txt B contain---------> aa.txt, bb.txt, cc.txt but aa.txt in A has different content from aa.txt in B. I'd like to parse the homonyms files in... (7 Replies)
Discussion started by: Dedalus
7 Replies

10. Shell Programming and Scripting

bash script working for small size files but not for big size files.

Hi, I have one file stat. Stat file contents are as follows: for example. H50768020040913,00260100,507680,13,0000000643,0000000643,00000,0000 H50769520040808,00260100,507695,13,0000000000,0000000000,00000,0000 H50770620040611,00260100,507706,13,0000000000,0000000000,00000,0000 Now i... (1 Reply)
Discussion started by: davidpreml
1 Replies
Login or Register to Ask a Question