General :: Script After Putting The File In Bashrc?
Oct 23, 2010
I have a problem with my script. The problem is the system keeps rebooting after I put the directory file in .bashrc. The intentional for putting the file in .bashrc is to run the script automatically after login as root, I don know why is this happen. It was working fine for the first time without putting the file in bashrc. I could break the loop after hitting the "ESC" key. would it be the script problems?
Here is my script
count=20
while [ $count -gt 0 ];do
sleep 1
echo Press ESC to break the operation
((count=count-1))
[Code]...
View 11 Replies
ADVERTISEMENT
Aug 11, 2010
I have a Tomato router and it has the capability to have its logs go to a external server. syslog is the obvious choice for this. So I enabled remote logging on my linux server's syslogd (syslogd -r) and I can see all of the logs in /var/log/syslog. What I want to do is take everything that comes from the IP of my router (10.0.0.1) and divert it to its own file like /var/log/tomato to avoid polluting my syslog with external logs.
I can't find any examples of someone doing this. My only solution is to get a script together that strips out any line in /var/log/syslog with 10.0.0.1 in it and puts the line into /var/log/tomato and have the script run as a cron job, but that seems unnecessarily messy.
Unless someone knows that there is a solution, I'm 95% sure that syslog doesn't support this after reading more in-depth of the man page. So I need to migrate to syslog-ng or make a crazy script that runs with cron.
View 3 Replies
View Related
Sep 18, 2010
Years ago on AIX I used to create a file of key strokes, including function keys (mainly F3 and F12) into a file, and used that file as input to an INFORMIX program, to automated tasks, something like this:
fglgo myprogram.fgo <keystrokefile.txt
Now, I'm using Aubit language on GNU/Linux, and I'd like to do the same kind of thing, but I can't recall how I worked out the chars for the function keys, I'm using a different emulation (xterm), and I can't work out what characters to put in the key stroke file. My $TERM variable contains "xterm". If I type "infocmp", I get this:
Code:
# Reconstructed via infocmp from file: /usr/share/terminfo/x/xterm
xterm|xterm terminal emulator (X Window System),
am, bce, km, mc5i, mir, msgr, npc, xenl,
colors#8, cols#80, it#8, lines#24, pairs#64,
acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
[Code]....
1. Is the above infocmp output the place I should get the information I need?
2. What chars do I need to put into my file to simulate me pressing F3 and F12?
3. Is there a way for me to put such chars in a file by just pressing those function keys (I tried a here document, but that doesn't work (it's as if the function keys are not even pressed)).
View 5 Replies
View Related
Apr 11, 2010
I accidently deleted my .bashrc file. I am a Debian user.Wat should i do??
View 7 Replies
View Related
Apr 16, 2011
I am trying to include my directory /usr/sbin in it's serch path for executable files using an environment variable. Would the input be: PATH="/usr/sbin"? And also upon start up, my shell should create the PRINTER environment variable which should resolve to the word sales...would that input be: PRINTER="sales"? If someone could help me with these two questions,
View 3 Replies
View Related
Feb 11, 2011
I want to assign the path of a sourced sub.bashrc file to an environment variable. E.g. if I type (or execute) from a known relative location
$ source ../../someDir/sub.bashrc
the sub.bashrc should set a variable like
export MyOwnLocation=/home/user1/unknownlocation/someDir
The problem is I can't use $0 as reference because the script is only sourced not executed. I also don't want to hardcode the path because the location might change and there will be more copies. Is there an easy way to create this information from within the the sourced bashrc file? I use Gnu bash 2.05b on Suse Linux 9.
View 6 Replies
View Related
Apr 15, 2011
attending class in the Redhat Academy Website. I was wondering how can you join the two commands of cd/usr & ls successfully in the .bashrc file?
View 10 Replies
View Related
Aug 24, 2010
I have installed a software and set the variables in the .bashrc file to avoid setting them everytime I would like to run te software. Now I have installed a new software and would like to do the same thing in the .bashrc file.How can I add the path to the new software directory without affecting the first software path.
View 2 Replies
View Related
May 28, 2010
I tried following the example from here (http:url]......)Open up publicity.html for reading and writing by anyone.
Before: -rw-r--r-- publicity.html
Command: chmod og=rw publicity.html
After: -rw-rw-rw- publicity.html
Here's my terminal session:
username@ubuntu:/etc$ -rw-r--r-- bash.bashrc
-rw-r--r--: command not found
username@ubuntu:/etc$ chmod og=rw bash.bashrc[code]....
View 2 Replies
View Related
Mar 3, 2011
I want to play around my .bashrc file, but I can't seem to find a general guide to customizing it. I just want a guide that will show me examples and explain them in-depth.
Does anyone where to find one?
View 2 Replies
View Related
Apr 27, 2011
If I want to modify my .bashrc file to change the HISTSIZE would the following command be for example; HISTSIZE=200? And if I want to change the DEBUG_LEVEL to 8 would the following command be; DEBUG_LEVEL=8?
View 3 Replies
View Related
Sep 3, 2010
I got myself a .bashrc file off the net. I checked it beforehand, didn't detect anything bad about it. One thing that's odd about it, is that several spaces are added to the terminal command line.Screenshot:Those spaces are not put there by me. The file can be found here: [URL]..
View 3 Replies
View Related
Feb 17, 2010
I am using Ubuntu 9.10. I was installing network simulator 2. After installation I get the following message.
Please put /home/administrator/Downloads/ns-allinone-2.34/bin:/home/administrator/Downloads/ns-allinone-2.34/tcl8.4.18/unix:/home/administrator/Downloads/ns-allinone-2.34/tk8.4.18/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.
[Code].....
My friend suggested that it is something to do with .bashrc file. I fund files like .bash.bashrc.
View 4 Replies
View Related
May 28, 2011
OK I have a simple script that does:
Code:
# Create temporary file:
pwFile="~/Tmp/temp.cnf"
echo "$password" > "$pwFile"
But I get an error message:
Code:
~/Tmp/temp.cnf: No such file or directory
View 3 Replies
View Related
Jun 14, 2011
When I add some path in .bashrc by commenting out old path and adding new one like this:
#EXPORT HOME_PLAY=/home/gem/old_play
EXPORT HOME_PLAY=/home/gem/play
EXPORT PATH=$PATH:HOME_PLAY
After saving above changes, I enter the command: source ~/.bashrc Now if I do echo $PATH, the path shows both the old PLAY_HOME and new PLAY_HOME. This is really bad and messes up a lot of things in my project. This problem only goes away if I logout or reboot, a rather very long process. What is happening is that the old path is added to new path element and the old path includes the old path element you want to remove.
View 10 Replies
View Related
Dec 1, 2009
Here is a way to prepare a USB flash drive to save your kickstart file to it, and then read the kickstart file from the USB drive during a new Fedora installation.A USB flash drive is recognised by the Linux kernel as just another hard drive.This is how I set up my USB flash drive to use it to store my kickstart file on.You will need a working Linux system to set up the USB drive.
View 2 Replies
View Related
Jan 1, 2010
Running Red Hat (not sure of the build atm) and I need to be able to put all of the IP blocking in a separate file. It will eventually be uploaded to a large number of hosting accounts, and modified from time to time...so it isn't feasible to modify that many httpd.conf files each time we need to add an IP to be blocked. In httpd.conf I can add the "Deny from" line to the following directive and blocks it just fine:
Code:
<Directory "/var/www/html">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
[code]....
There is an include to pick up all *conf files in ../conf.d, and everything else in there is working just fine. I created a file called robots.conf; it currently has a set of mod_rewrite rules which work. So I added this to that file:
Code:
<Directory "/var/www/html">
Order allow,deny
Allow from all
Deny from 123.456.789.098
</Directory>
It is not blocking access from the IP with it in there.I've done all of the usual things; restarted Apache, cleared browser cache etc. I can also block it using that same directive in a local .htaccess.
View 2 Replies
View Related
May 30, 2011
recently I did some changes to my bashrc file the changes are as follows
export JAVA_HOME=/usr/java/jre<version>/bin/
export PATH=$PATH:/usr/java/jre<version>/bin
now I'm unable even login to the OS.
View 9 Replies
View Related
Apr 20, 2010
I am having a lil headache with it.
Some time ego i edited my /etc/bashrc file to add some aliases and colours for my ssh console.
Today i had a need to change few thing but for some reason i can't edit or delete this file any more.
I am logged as root.
rm bashrc
cannot remove, operation not permitted
chown and/or chmod fails as well with "not permitted" errors.
ls -Al | grep bashrc
-rw-r--r-- 1 root root 2514 mar 31 13:05 bashrc
Any ideas what's going on?
View 2 Replies
View Related
Aug 3, 2010
I tried to set up an alias for update, upgrade and clean by putting this line into my .bach.rc file
Code:
#alias ud= 'aptitude update && sudo aptitude upgrade && sudo aptitude dist-upgrade && sudo aptitude autoclean' but when I type ud I get this error message, by the way I tried the bash.rc entry both commented and uncommented with the same result.
[Code]..
View 4 Replies
View Related
Mar 24, 2009
I'm looking for a way to make a bootable floppy that has drdflash.img, my flash utility and my bios file on it for a bios recovery disk. This is on a board that has a failed bios, so everything is pretty much dead (except for the humble floppy drive). I don't have a screen to work with so this floppy needs to be able to run the utility and automatically flash the chip for me. I've heard this is possible, but am unable to find clear instructions on how to do any of this. I know the basics of it is to copy the bios file and flash utility to a floppy along with a bootdisk that will run these things (sometimes the .bat file needs to be modified in order to do this automatically). So I've downloaded drdflash but it came as a .img and I don't think it can be 'just' copied to disk. I came across the 'dd' command but have also heard its nicknamed 'data destroyer' or words to that effect.
View 4 Replies
View Related
Oct 6, 2010
how come I can create a shell script file with two functions, I can execute the file, but when running declare -f, the functions are not on memory, and when invoking the function bash returns invalid. In the other hand, I can copy & paste the two functions at the end of my /etc/bashrc file.... then I can called the function by name.... and the commands within that function run on my session. here is a print of all my bash packets:
[Code]....
Does Fedora has restrictions on shell scripting? I haven't touch bash in seven years, so if things have change on it I'm behind on it, and sorry for my ignorance.
View 1 Replies
View Related
Mar 29, 2011
Here is the issue. I am reading in a outside text file and putting in the string on that line into a char array that is already allocated.
Code:
int main(int argc, char *argv[])
{
[code]....
View 1 Replies
View Related
Feb 27, 2011
I want something like
Code:
export ROS_PACKAGE_PATH=~/ros:$ROS_PACKAGE_PATH
to be done already for me when I open a new terminal. How do I edit the .bashrc so that this variable is always set already?
View 3 Replies
View Related
Jan 20, 2010
Noticed the statistic from the computer that it had taken 147MB from the internet today and put 8MB out. Why did it put out so much data, 8MB, why would it need to do that? It makes me paranoid.
View 8 Replies
View Related
Jan 21, 2011
I am currently trying to install Sabayon linux, and it expects to use Grub1 for booting from usb (what am I trying to do). So I copied grub files into boot section, but now I need to "root and setup" it - and that's what I can't do, because I don't use Grub1 normally, since I am on Ubuntu which uses Grub2.
(I decided to use Grub1 instead of Grub2 because Sabayon could have some special params, and I am not that much experienced to copy them in new format to grub2 configuration file). So my question is - is there a way to copy grub1 to MBR without having it installed? (using some utility or something like that).
View 11 Replies
View Related
Sep 29, 2010
I have the following as my $PROMPT_COMMAND in .bashrc:
Code:
PROMPT_COMMAND='
if [ $TERM = "screen" ]; then
MYPWD="${PWD/#$HOME/~}"
[ ${#MYPWD} -gt 20 ] && MYPWD=..${MYPWD:${#MYPWD}-18}
echo -n -e "33k$MYPWD33\"
fi
'
I am trying to append items to my PROMPT_COMMAND in another script/on command line. If I do the following:
[Code]....
I get no error. I've echoed the value of $PROMPT_COMMAND in both cases and their output is exactly the same.
View 4 Replies
View Related
Feb 25, 2010
I'd like a function in my .bashrc file that would allow me to pass text to it and echo the text to a specified file. I know it's simple as "echo 'text' >> file," but ideally, I would want to alias the function so I execute something like:
Code:
user~ $ write 'this is a test' with "write" being the function, and 'this is a test' being echoed to the file. I hope I explained that well enough.
View 3 Replies
View Related
Apr 5, 2010
A cluster with a head node and compute nodes. An application with a couple of env variables (App_HOME, PATH) set in .profile (default shell sh). If I login to the head node/compute nodes on a terminal everything works fine. The correct env variables are set and the application works. However, when my application tries to do it, say ssh <compute node1> <application>, it appears the environment variables are not available. It only looks in the minimal /bin, /usr/bin type PATH. This tells that the .profile is not being read
View 2 Replies
View Related
May 27, 2009
I wanted to put password in lilo.conf file. I added this line but doesn't seem to work out Code: password=vickey. I also did Code: lilo -v Is there any thing missing
View 8 Replies
View Related