Hi All,
I need an assistance with the issue below.
I wrote big script in "bash" that automatically install an LDAP on Clients.
I'd be happy to know in order to avoid duplication of entries in files,
How i can define into the script, if the specific expressions already exist in the file, do not add them again.
For example i take the following section from the script :
How i define in the script , only if the value are already exists in the file , do not add it again.
i have the same thing with sections that write expressions to more files.
The thing is that i sometimes i need to run the script more than once on the same server,and as a result of that it created duplicate values in multiple files.
Thank you guys,
Aviel.
Last edited by Scott; 07-30-2013 at 05:12 AM..
Reason: Removed excessive formatting; added code tags
At the section :
Where i should put the expressions before or after this section ,
And how do you write the expression you gave me that would be suitable for the pare here,
Thanks ,
Aviel.
Last edited by Scott; 07-30-2013 at 05:13 AM..
Reason: Removed formatting; added code tags
I am trying to look through one of my directories to remove certain files. I am pretty new to Unix and bash so I just need a little help in starting this. I know I would have to write two loops one to iterate the directories and one to iterate the files. How would I write the loops? (3 Replies)
Hello Coders
Some time ago i was asking about python and bash performances, and i was told i could post the regarding code, and someone would kindly help to make it faster (if possible).
If you have noted, i'm on the way to finalize, finish, stable TUI - Text(ual) User Interface.
It is a... (6 Replies)
Hello All,
I was writing a Bash shell script that will be executed on both an AIX server (/usr/bin/ksh) and a SLES server (/bin/bash). The AIX server
has Bash installed at "/usr/bin/bash", which is in a different dir then the SLES server.
So basically I am writing the script on the SLES... (4 Replies)
Hello,
I want to write a bash script to delete the content after '#'. However, if '#' appears in a string with "", ignore this. For example,
input file:
test #delete
"test #not delete"
Output file:
test
"test #not delete"
Does anyone know how to write this script?
Thanks (1 Reply)
Hi Folks,
I have a loop that goes through an array and the output is funky.
sample:
array=( 19.239.211.30 )
for i in "${array}"
do
echo $i
iperf -c $i -P 10 -x CSV -f b -t 50 | awk 'END{print '$i',$6}' >> $file
done
Output:
19.239.211.30
19.2390.2110.3 8746886
seems that when... (2 Replies)
Hi Experts,
Need your help.
I am trying to send a command via ssh to about a hundred network devices. I intend to do this via a bash script something similar to the below:
ssh -l user testmachine.com "show version"
Obviously this will not work given the password prompt that comes... (2 Replies)
Hi,
I want to create a script that gets a filename as an argument.
The script should generate a listing in long list format of the current directory, sorted by file size.
This list must be written to a new file by the filename given on the command line.
Can someone help me with this?
... (6 Replies)
Just one question for bash shell script.
In bash script, you can use *.txt to call any files in current folder that ends with .txt, like
rm *.txt
will remove all txt file in current folder.
My question is can you actually remember or use the file name among *.txt, I know file=*.txt will not... (9 Replies)
I want to make shell script that takes a list of host names on my network as command line arguments and displays whether the hosts are up or down, using the ping command to display the status of a host and a for loop to process all the host names. Im new to shell scripting so Im not quite sure... (3 Replies)