Do not use on any
shared computer
July 25, 2008 03:13pm pdt

Experts Exchange is proud to recognize the top quarterly Experts of 2008. These Experts have risen to the top, so CONGRATULATIONS!

 

Welcome! If you have any general questions about Experts Exchange, feel free to ask me.

 
Time Tested bash Solutions: 1 - 25 of 62
null
Hi, Is there a sleep command or something in bash I can use to slow a script down?
How do I read all lines from stdin into 1 variable in bash script? "read x" will give me just 1 line but i need x to store everything from stdin until EOF.
how do i recursively grep (search text files) in unix? for example, if i want to find the word "example" in a unix directory and all its subdirectories?  i want the file name, file path, an...
I'm trying to create a BASH script to perform the following tasks and I'm stuck on step 4 1) login to remote FTP server 2) download all *.txt files to $HOME/$DATE directory for that day (i...
Hi, How can I make a bash script terminate if a file exists? The file mask i want to check is Create*php thx
I have a bash script that monitors a log file using swatch.  I have had problems with swatch after the log file is rotated, so I setup a cron job to restart the script after the log file rotat...
A command returns a code after its execution, typically 0 if it went ok, or a code > 0 otherwise. In bash, how to detect the exit code of the previous command, and assign it to a variable? ...
Hi all, Can somebody write me a bash script that will do the following? 1. Echo the current date and time and append it to a logfile called mylog 2. Execute another cmd called xyz and a...
In a bash script, I need that if a command fails, the script exits. Now I do as follows: ++++++++ cat example.txt if [ $? -ne 0 ]; then exit; fi; ++++++++ is there a more compact wa...
how do I use awk to filter out first two columns in a file?
I have a file with content:        AAA   10        AAA   1        AAA   2        CCC    1        CC C   0        BBB    20        BBB    1 how can I use Unix sort to sort this file to ...
Hi All, I need  a cash shell script to go out and fetch a bunch of xml files stored on a password protected ftp site.  I'm about half way there with the following command: wget -O myfile1.xm...
I'm using Fedora 8. I've written a simple "hello world" program -- it prints hello world to stdout and then writes a line to a file every 10 seconds. I have put together an init script to s...
Hi, I have the following unix bash script. I have the following lines. As you can see I am processing a text file and replacing IP addresses with a hostname. What I would like todo is have ...
I am looking for some help in writing a script in bash to run on the Mac OSX/Unix. I have a file that I want to search and find a key word in the sentence, example "#define VERSION" once ...
How do I count the numbers of characters of certain types in a file "FILE"? The output should be e.g. A:72344 B:2374 C:3247823 etc. etc. if FILE contains 72344 letter 'A's etc.
I need some help with an interface on a Linux machine (RedHat AS4) but I am no expert in the Bash shell.  If this was Windows, I would have no problem writng the batch file to do the job. H...
Question about use of regular expressions on the linux command line (bash): Could someone explain why each of the following behave as they do? I am quite stumped: [Ignores the escaped ...
I'm using Fedora 8. I have an initscript for my app which sets some variables, and then starts the process as another user. ex: LOGFILE=/usr/local/code/myprog/logfile.txt PATH=$PATH:/u...
Hi Experts, I am writing a bash script to find the largest 5 files in my account, the script works fine but it ignores files having white space in their names, I need someone to help me to ...
i'm having to tweak a bash script, which I dont' know much about... this script, in turn, calls about 5 other shell scripts. i need the last shell script to return a variable to the calling...
hi all, can somebody show me how to do the following? I want to run the route command, and grep the output. if a specific IP address is listed then I want to execute a command. otherwise...
From the console, I am executing two or more commands, such as: $ ls >list.txt; sort list.txt >list2.txt; cat list2.txt if one command fails, the following commands are still executed. ...
I need to be able to copy all files/subdirectories from one particular directory on one drive to another drive... but only files / directories that do not already exist on dest drive or are ol...
Hi there! is it possible to remove all sort of code injection in a parameter? I have this ultra simple code, that uses the bash parameter in another command. I don't want that the user ha...