General :: Running Bash But Common Bash Commands Not Working?
Jul 17, 2010
below are the details of my system. I have bash as my current shell, some really common commands aren't working.
Do I need to do a re-installation of bash? Or how do I install a selection of bash commands which I need? (for example a subset of [URL])
Code:
root@sdptfw:~ # uname -a
Linux sdptfw.sdpt.co.za 2.4.36 #1 Tue Jul 22 13:13:24 GMT 2008 i686 i686 i386 GNU/Linux
root@sdptfw:~ # echo $SHELL$
/bin/bash$
[Code]....
View 13 Replies
ADVERTISEMENT
Aug 1, 2010
I would be running SQL commands (UPDATE/SELECT) from within my bash script. I am completely new to this subject. Is MYSQL used for this purpose? Alternatively, what is sqlplus?
View 6 Replies
View Related
Apr 16, 2010
Is there anyway to test a bash script without actually running the commands to see if the syntax is proper? Google is of no help.
View 5 Replies
View Related
Jun 14, 2010
I am running a simple script that I copied from slug.ceca.utc.edu/docs/2009-3-26-linux-server-health.pdf and edited with the names and paths of my own servers. I don't know much about scripting (re: nothing) but I wanted to try and be efficient in my new role as a Linux Sys Admin. The script was saved to root's home directory and runs as part of root's crontab once a week. The script runs with no problem, but it doesn't actually seem to run all of the commands contained within. It skips some in the middle and the end and I don't know why. The script itself is this:
Code:
#!/in/bash
uname -a > /tmp/server.txt
[code]...
View 5 Replies
View Related
Dec 3, 2010
What happens when the script executes is that the ssh connection works and parks me at the remote hosts's shell login. Therefore, the "firefox" command refuses to execute. I need to know how to make the "ssh" connection occur, stay open, and go into the background so that the rest of the script can execute.If I could also do this with the "firefox" line so that the entire term window could be closed would also be helpful.
View 3 Replies
View Related
Jan 15, 2010
I've got an annoying problem that 'man' and some other commands do not auto-complete (via TAB). e.g. typing: man rsyn (TAB, TAB, TAB, etc) will not auto-complete to 'man rsync' however, if i 'sudo -s' & then try the above, 'man' auto-completes everytime. (Directories always auto-complete successfully) My ~/.bashrc contains:
Code:
# enable bash completion in interactive shells
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
[code]....
View 8 Replies
View Related
Sep 10, 2010
This is a really odd bug I can't seem to figure it out. Basically, commands like ls can see all the files in the current directory, however when I go to execute the file it will give errors like "file not found", even when it most obviously is. If you look at my command history in the screenshot, you can see I can ls into a directory and see it's contents. When I try to run the file, I get the "no such file or directory" error.
However, if I type simply 'vm', I can't use tab completion to complete the directory name, and my third command is me typing 'vm' and hitting tabtab, it lists a bunch of vmware specific tools instead of the subdirectory name. I can then ls and see my current directory contents, and it will list only the single subdirectory. However, then I tried to use the full filepath from root to run the file, still to no avail. If anyone has any insight,
View 2 Replies
View Related
Jul 31, 2011
is there any way I can pass commands to the CLI of a tool directly?
I would like to script some actions, for example:
./OpenBTS < "tmsis"
I do not need to retrieve the results (I watch it in the log file). how I could realize that? There is now way to do this using command line parameters, at least not that I found out. So it looks like I have to figure out sth myself. Maybe I could automate screen in a way to detect the prompt and "paste" my command there. Are there tools for this on Linux?
View 3 Replies
View Related
Sep 14, 2011
Is there any way to list just the folders in a directory using bash commands? ( as the ls command lists all the files and folders )
View 3 Replies
View Related
Apr 28, 2010
I made a script that contains repetitious commands (snmpget and awk are the only ones at the moment. Running these commands from standard terminal work, but when run within a script, I get:
./reg_sm_count: line 10: snmpget: command not found
./reg_sm_count: line 10: awk: command not found
./reg_sm_count: line 10: snmpget: command not found
[code]...
View 2 Replies
View Related
Dec 2, 2010
I'm creating a bash script that contains the following line:"ssh user@$server1 cd /tmp; pwd"What I want is to print /tmp of server1, but the script it isn't printing that
View 2 Replies
View Related
Jan 11, 2011
I'd like to add custom startup commands (for example starting a process, registering to a registration server, downloading a configuration file) to the Linux startup process. Those commands should be triggered on startup only. What is the standard/appropriate way to do this?
EDIT: Is /etc/profile the right place to trigger such things?
EDIT2: I'm using Ubuntu.
View 4 Replies
View Related
May 31, 2010
I wrote a simple bash script to let me treat any set of programs like a deamon. For example if I configure the script a certain way I can start/stop/get the status of apache, mysql and php all from one command. I am having a bit of a problem though. I am passing commands as strings to a function and then depending on the arguments to the script it might run one of these commands or another. Some of these commands need to beun in the background though, such as deluge-web. When I send "deluge-web &" to the function and it execute it deluge-web does not start in the background. I can't figure out why this is. I have tried escaping the & with ''s and with a , but nothing seems to work. I know that this is some idiotic thing that I am overlooking, but I am a bit stumped. Here is the script configured to start/stop/get status of deluged and deluge-web.
Code:
#!/bin/bash
function checkanddosomething {
[code]...
View 3 Replies
View Related
Jan 12, 2010
i want to delete some say 10 previous commands in bash shell!
View 3 Replies
View Related
Jul 26, 2010
I presume there is something in the JWM window manager - or Puppy Linux Lupu 5.01 itself that is conflicting with the normal loading of GMPLAYER....
I would like to know how to troubleshoot, and fix this problem if possible (even a workaround would be great).
View 1 Replies
View Related
Mar 13, 2011
$ execute_some_long_command <command is executing> <Accidently press middle button that inserts bunch of garbage (including, for example, `rm -Rf ~/*`) into console>
How to let execute_some_long_command finish, but not execute inserted things?
View 1 Replies
View Related
May 26, 2010
I need to process billions of small files using bash shell commands with limited memory size (256MB). If any of those files contain certain "keywords", the file will be removed. I tried with command:
find . -type f -exec grep -i -l -H "keyword" '{}' + | xargs rm -rf
where all files are located within the current directory. But the command above failed in "out of memory".
View 1 Replies
View Related
Nov 29, 2010
I create a bash script that writes another bash file. But in the generated bash file I want to write a bash command in the file and not executing it.Here's my bash file:
Code:
#!/bin/bash
cat > ~/generateGridmix2data.sh << END
[code]...
View 6 Replies
View Related
Mar 12, 2010
I have a hardware audit script I want to run on several remote machines around my office. Is there a way to run the script that resides on my machine via ssh or do I need to copy the script to the local machine and then run it...
View 4 Replies
View Related
Apr 16, 2010
I know I have to count how many instances are running: ps x | grep apache2 | wc -l result if it's running: 2, or else: 1 I also know there is a command called test that I could use to perform the verification, but I don't know how to use test with wc
View 3 Replies
View Related
Nov 2, 2010
I've got this simple script called test1, which I'm trying to execute in a bash shell using ./test1
Code:
#!/bin/tcsh
echo 'Hello world!'
[code]....
View 3 Replies
View Related
Apr 3, 2011
so I wrote a small script that pretty much just takes in two numbers and counts from the first to the second, e.g.
unknown-hacker|544> count.sh 1 3
1
2
3
My problem is I want to make it so that if you input invalid parameters, such as non-numerical characters, more than 2 numbers, etc., you'd get an error message
View 15 Replies
View Related
Mar 27, 2011
I've been trying to write a bash script called runSorter.sh that runs an executable that also takes in some parameters and outputs the results to a text file. The executable, sorter, takes in a number parameter. I want to make it so that you can input as many number parameters into runSorter.sh as you want and it will run the sorter executable for each one. So far, what I have looks like this:
#!/bin/bash
args=("$@")
INDEX=0
if [ -z args ]; then
echo "Error"
else
while [ $# -gt $INDEX ]; do
NUM=${args[$INDEX]}
echo $NUM
echo ./sorter $NUM
let INDEX=INDEX+1
done
fi
My problem is that when I run ./run-sorter.sh 100 on my terminal, it just prints this to the screen:
./sorter 100
How can I have so that it properly executes sorter and outputs everything to a text file?
View 4 Replies
View Related
Nov 25, 2010
I am a newbie in linux. I tried to write an autorun bash script on /root and select System-Preferences-More Preferences-Sessions-Startup Programs-Add.But the bash script seems like not working. Following is my bash script:
#!/bin/bash
#
#chkconfig:345 99 99
[code]...
View 8 Replies
View Related
Aug 16, 2010
How can I check which version of bash I'm running
View 2 Replies
View Related
Nov 13, 2010
I have a bash script that messages the user periodically. Is there any way in the script to check if the screensaver is running, so the script doesn't spam messages while the user is away? The xscreensaver process is always running in the background, I've noticed.
View 5 Replies
View Related
Oct 8, 2010
I have a PGP script that for whatever reason if I let linux's cron run it automatically, it sends out the final email with attachment with a blank file. If I come in and run in manually everything works fine and the file is populated in the file. So the only real difference is that i'm running it manually through cron, rather than letting cron run it at a set time.Below is a sumary of my script.
Code:
#! /bin/bash
#PGP Decryption Bash Script
[code]...
View 6 Replies
View Related
Aug 6, 2009
I'm setting up a scheduler to run some bash script commands but they won't run when I point them to a script file. If I change the cron to call
[code]...
If I run ./writeTimeToLog from the terminal - it, well, writes the time to the log file! I then use
[code]...
to test I can schedule this to run every minute just so I can see it working. the entry was a basic as I could make. It adds the cron successfully but never seems to update the file. Where would an error be put if one occurred.
View 2 Replies
View Related
Apr 7, 2010
I would like to be able to connect to a machine, list a directory, wait long enough for me to see the results then move on to the next machine.This is failing:
Code:
#!/bin/bash
while read line; do
[code]...
View 3 Replies
View Related
Apr 25, 2010
want to set more text files. They have "tab" differently (3, 4, 6 or 5 characters space).I have to use "sed" or "awk" sette them in the same tab (for example five space haracters).
View 14 Replies
View Related