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...
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,
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...
how do I use awk to filter out first two columns in a file?
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...
Hello
I have a bash script that parse a text file variable $essid_string with content like this:
ESSID:"Shopping City WiFi"
I want to extract the substring betwee...
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...
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 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 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 ...
Briefly, I need help writing a bash shell script that can go into a directory (recursively) and extract all the .tar.gz archives it finds, and then pipe all of the extracted text files into a ...
Hi
How can I put a numerical value to bash script variable from text file?
I have a text file with entire numerical values in some strings:
$cat numbers.txt:
23424
534
234566
95
...
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.
...
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 have this script that will search through one level folders and if there are files found than gzip, delete fles and than move gzip to archive folder. The problem I have is when it finds more...
Can someone help me create a BASH shell script that reads a text file with entries like below. And creates a menu.
Basicaly the script would read the txt file for the site names and output ...
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 ...
Hello everyone,
I´m working with a "job table" (mysql). In this table you can find different params that are being used for a php-script. This script works on my database and file operation...
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 ...