Advertisement

635 organizations, including eBay, Ericsson and Lockheed Martin, now work smarter with Corporate Accounts. Save up to 42%

 

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

 
Time Tested bash Solutions: 76 - 100 of 157
 
Complete the bash script below.  Points awarded to the smallest/fastest, most maintainable code.  Please don't write it in perl or python -- this is a bash question.  If you must use per/sed/a...
I'm getting an end of file error, and not sure why.
I use the "ls" command to list the directory and get the output as below. AAA.BB-1   AAA.BB-10 AAA.BB-2   AAA.BB-3   AAA.BB-4   AAA.BB-5   AAA.BB-6   AAA.BB-7   AAA.BB-8   AA...
Hello, I'm in need of a script or a one-liner command by which I can find the files with a particular "string". Say if i want to identify all the files (under /etc) with a word "priority...
Hello group, I'm in the middle of a development but an unexpected request has come and I have to read some elements in an XML file. How can I do this using Bash (using regular expression)? ...
Hi, I need to write a unix shell script to find any "email id" from a particular directory which has sub directories and many text files (text files contain email ids and other text) in it....
I am writing a script that when run will ask the user to enter a password. The function will be something like: function func_somethin() { read -p "Enter User Password: " DBPASS echo '${D...
I'm trying to automate encrypting and adding passwords to PDFs via a BASH shell script in Linux.  Is there a command line utility that accomplishes this?
Hi there, I assume this will be trivially easy for someone who knows bash scripting.  In my .bashrc file, I have a bunch of statements to define aliases.  For example: alias more='less' ...
I have a very simple script that ftps files to my webserver using task scheduler.  This works great when i am only copying a single file but now i need it to copy all folders under C:\test to ...
Can't get $1 input to work in the following function. Need assistance with syntax. Thanks! function lookup () { /usr/bin/ldapsearch -1TL -h `hostname` -p 389 -D 'cn=Directory Manager' -j ...
I need to know how to translate an IF/THEN statement that works fine in any shell (BASH, SH, CSH...ect) into something that is understandable by the crontab. This is going to be used to run do...
How can I construct a  loop in a bash script which loops over the lines in the file. On each iteration of the loop I want to read the line into some variable.
I'm trying to write a shell script (bash) which simply takes a list of directories (using ls) and passes them to a kdialog for a user to choose from. What i have so far works fine for direc...
OK, I'm having a bit of a problem concentrating on work today... Holiday in 2 days!!! :-) I need to write a script that produces this output;      alicreate "MYALIAS","00:00:00:00:00:00:...
Can anyone tell me how to find a pattern in a string of text in a variable using Bash in Linux? Example: var=Line 1: This is a line I want to be able to search var to determine if : is ...
I have a postgresql dump file which I want to import to version 8.3 I need to replace numeric data in this file with format "10-25-2004" to "25-10-2004". i.e. the middle  field needs to be s...
Hi, can some one let me know how I can use an awk script to be able to search every line in the file and find the state and zip code and insert a comma(,) between the state and zip fields. My ...
Hi I have a back up script that runs every hour,  in the script I used the date function to create a suffix for the archive created for the backup suffix=$(date +%y%m%d.h%k%M) The sc...
Hello, I have the following bash code fragment: x=0 for i in $(locate $1) do     dnames[$x]=$(dirname $i)     let x=$x+1 done Which assigns the output of a locate command into th...
command used to synchronize changes done in /etc/passwd to /etc/shadow file?
Hi! I'm trying to use a bash script to send already drafted emails at a scheduled time (cron) using sendmail. The script specifies the IMAP mailbox to check and sendmail then sends the emai...
I log into a remote server using ssh. Then I start a program in a background. When I exit ssh session the program terminates. How to keep it running?
Hi guys hope you can help. Ive got the following code snippet that is not working when using the read function. echo -n "Enter the menu1 parent folder name that this menu2 file will resi...
I have a daily cronjob where I backup all of my databases on my two linux servers.  Currently, I have no way of knowing if this even works, if any errors were reported, etc.  I am not too sure...