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.
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...
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 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?
...
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...
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 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 ...
how do I use awk to filter out first two columns in a file?
Hi,
Can anyone explain to me how to create (or simulate) a hash table in a Bash script in Linux? I know that Bash uses some internal hash tables to store commands, but I need to create my ...
HI,
Im having problems with my bash script that I am using for automated zenwork imaging. I always get a elif error on line 23. Error message is Syntax error near unexpected token 'elif' ba...
Hello
1. I know that Ctrl + Z will undo last changes you made. I couldn't find that in nano text editor.
2. When I search for word ex. joomla what is the key I need to press in order to p...
I am trying to get a concept where I can create simultaneous running child processes from a parent and able to read their exit status as soon as they come in. Once the exit code is read it wil...
I am new to bash scripting and linux. I have a bash script that I have been working on that will take a path to a dd disk image file and pass it into fdisk to parse out some information. The i...
How do I test if a variable is an integer in BASH?
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...
I have a multi function bash script that needs to have good logging. I am currently using the following method, however is not exactly ideal.
function name() {
stuff here | tee -a ${LOG}
...
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...
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.
Hi,
How can I make a bash script terminate if a file exists? The file mask i want to check is Create*php
thx
Deltree used to work for deleting a directory with subdirectoris and files, but no longer work in windows 2003. Is there any command I can use to delete a non-empty directory or any DOS batch ...
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.
...
Good Evening,
I have a script that was written by someone else that we need to run. Unfortunately we are getting unexpected end of file errors. We are hoping someone can take a look at it a...
Hi there,
using the script described <a href="http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/bash/Q_24693599.html ">here</a> I receive a date/time in the following form...