General :: Joining Two Commands In The .bashrc File?
Apr 15, 2011attending 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 Repliesattending 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 Repliesrecently 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.
I need to occasionally touch a file with the current timestamp as the filename. I would do so this way:
touch `date "+%Y-%m-%d_%H-%M"`.txt
However, I'd like to define an alias for this. When I try adding to the bashrc this:
alias td="touch `date "+%Y-%m-%d_%H-%M"`.txt"
the result is that the filename is the same during the entire session, since the `date ..` gets calculated just once during login...
How can I get the command to expand only when I call the alias? Or must I use a function for this?
How to compare two wav files [URL] or to be capable to reco simple voice commands? Openbox, fluxbox... can be ran using perlbox voice reco for basic commands. [URL] everything is frequence based:[URL] However we would like to make the use of the ALSA and processing after recording. OK.
Code:
apt-get install -f sphinx2
here is my script:
Code:
#!/bin/sh
# my alsa-1 is my usb mic
arecord -Dplughw:1,0 -f cd -vv voicecommand.wav
[code]....
THe next step is to analysis the wav file just created. The advantage is that sphinx2 works for basic commands + it uses only up to 3% of your CPU resources !
I'd like to know if there is a way to define commands in the .bashrc or .bash_profile. For instance, I want to be able to type 'work' in a terminal and set up an interactive work environment on my universities cluster. (This is done with the command 'qsub -I -X'.) I tried the following in my .bashrc file:
alias work ='qsub -I -X'
But, of course this failed, as I don't have a command work already defined. How do I go about doing this? Also, I can't assign 'qsub' an alias, since it's used with different options quite extensively.
I accidently deleted my .bashrc file. I am a Debian user.Wat should i do??
View 7 Replies View RelatedI 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 RelatedI 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.
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]...
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 RelatedI 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]....
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?
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 RelatedI 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 RelatedI'm trying to transfer a large .tgz file from a CentOS dedicated server to a linux webhost (unknown OS). The problem is the webhost will not allow a 1.1gb file to be uploaded, however it will allow the upload in 149MB chunks. I used the split command to segment my tgz into 7 segments under 150mb. I then uploaded all segments via FTP which worked. Then I tried to join the segments to create the original tgz. The join appears to work with no issues. However, when I try to extract the tgz it appears there is a problem, most, but not all files are extracted and there is this error message:
Code: gzip: stdin: Input/output error
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now It appears the join did not work and the tgz is slightly corrupt. What am I doing wrong? Here's the commands I'm using:
1. Create the original tgz on the dedicated server
Code: tar -czf mysite.tgz ./myfolder
2. Split the tgz into segments
Code: split -b 149m -d mysite.tgz seg
# using the -d switch so the segment files use a numerical suffix
# I now have these files:
seg00
seg01
seg02
seg03
seg04
seg05
seg06
seg07
3. Transfer segments to the other webhost using FTP
Code: # hand typing (not a script)
ftp ftp.mysite.com
myusername
mypassword
binary
cd somefolder
put seg00
put seg01
put seg02
# through to seg07
4. Join up the segments on the new webhost
Code: # this is in a .sh script file
cd /full/path/to/somefolder
cat seg* > mysite.tgz 5. Extract the new tgz
Code: # this is in a .sh script file
cd /full/path/to/somefolder
tar -xzf mysite.tgz
# the above error is now thrown.
That's it. What am I doing wrong that's causing the above error?
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.
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.
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?
How would I rename a file say old.txt to new.txt in Linux using commands?
would it be...?
rename old.txt new.txt
So here's what I'm after:
Create Ubuntu inside Virtualbox (done) Join it to the domain using net ads join -S example.com -u admin (done) Update the DNS using net ads dns register (done) Be able to visit the netbios name as defined in smb.conf (lets call it Bob). [Not done]
The problem I am having is that it looks like, even though the machine is now on the AD, and I can browse users in the AD, etc... My network configuration (IP/route tables, etc) are not correct.
For example, my AD server is in the 172 IP range, while BOB is sitting at 10.0.2.15.
The DNS server stores Bob's value as 10.0.2.15, so when I ping it from my workstation at 172, I end up getting no response (obviously it's on a different net).
Bob's route table is configured to deal with 10... range of IP, rather than 172.
I have attempted doing commands such as ifconfig eht0 172.16.1.118 netmask 255.255.255.0 and even editing the route tables, but that then makes outbound network traffic imposable.
I'm looking to, all in the course of one batch file:
ssh into a remote computer execute commands (per the batch file) on the remote host.
What options do I need to add to the ssh invocation so that the batch file executes the lines following the ssh invocation over the connection?
e.g., with sftp it's simply adding a -b /dev/stdin and then << EOF at the end; how do I do this with SSH?
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.
I'm looking for a solution for the following simple problem. I have two files, fileA and fileB. Each file contains only one word per line, and they contain exactly the same number of lines. I would like to create a new file called fileAB, where the i-th line contains the i-th line of fileA, a Tab separator character, and then the i-th line of fileB. I know how to do it in Python or other scripting languages, but it would be nice to have a bash one-liner for that. Is it possible to do this in bash or any other Unix shell, using the tools that are usually available on the command line (e.g., sed, awk and such)?
View 1 Replies View RelatedI have created a linux vm on hyper-v and would like to put it on our network domain. The Hyper-V software is running on windows server 2008. I would appreciate it if you could please give me a step-by-step guide on how to make this possible or a reference where i can get information on how to do this.
View 1 Replies View RelatedMy new VPS is running Debian 5.0 (bash 3.2.29), and some commands seems to be missing. For example the ps command is not here, neither is ls (but dir works). Is there a package missing or what's the deal?
:~# type ps
ps is hashed (/bin/ps)
:~# ps
[code]....
Is there any commands or scripts to remove only selected line in the history file.
View 1 Replies View RelatedI want to make a file called file roller for Ubuntu 9.10. The folder has a file called install.sh and some others that are make.
I figure first I need to make a file and then run install.sh to install. But I don't know how to do this.
I have ~200 c files in my makefile[$(SRCS)], and it compiles all of the files using a single gcc command. So each time I make a change in one c file, it ends up re-compiling all the files, then linking to make the
binary. How can I break out the compilation into individual gcc commands for each c file, so that make checks the timestamp and accordingly compiles only the modified files.
My current Makefile looks like this.
clean:
i use ncftp for some bash script action. how to delete oldest directory and oldest file using ncftp commands?
View 3 Replies View RelatedI have a few questions to ask, so please pardon me
1) How to check for https in commands config file for Nagios? I only know how to check for http, not sure for https.
2) The log file in Nagios, is it possible to extend Nagios's plugins (or are there already have plugins existed) so that we could actually make use of the log file to check for status of each and every services in different hosts, instead of looking through the log file manually which can be very time-consuming if the list is very long.