Search Results

Search: Posts Made By: dexdex200
3,938
Posted By dexdex200
Try using this as the original folder name: ...
Try using this as the original folder name:

/OriginalFolder/* instead of /OriginalFolder/

Also, what version of find are you using?
1,936
Posted By dexdex200
ok. insightful -- doing the cd in a subshell....
ok. insightful -- doing the cd in a subshell. thanks!

---------- Post updated at 02:14 AM ---------- Previous update was at 02:13 AM ----------

exactly what i was hoping to find. thanks.
1,936
Posted By dexdex200
Test if a script can cd into a directory
Is there a way for a bash script to test if it can cd into a directory without actually attempting to cd into it?

I am looking for something along the lines of:


if [ -d $dir ];then
...
19,529
Posted By dexdex200
Try this:, However note that all output will be...
Try this:,
However note that all output will be hidden.

(
/usr/bin/expect <<EOD
spawn ssh user@server1
expect "*? assword:"
send "pw \r"
expect "$"
send " sh ./filename1 \r"
expect "$"...
19,529
Posted By dexdex200
You should try this: ( spawn ssh...
You should try this:


(
spawn ssh user@server1
expect "*? assword:"
send "pw \r"
expect "$"
send " sh ./filename1 \r"
expect "$"
expect eof
) > /dev/null
(
spawn ssh user@server2...
14,269
Posted By dexdex200
Check your quotes. Try this: Change ...
Check your quotes.

Try this:


Change


rsh $SERVER '/usr/sbin/useradd -g dbagroup $line'
rsh $SERVER 'echo $line"123" | passwd --stdin "$line"'


to


rsh $SERVER "/usr/sbin/useradd...
Forum: Programming 02-07-2013
5,287
Posted By dexdex200
That is happening because you are running the...
That is happening because you are running the script wrong. Your script expects 3 arguments as input -- ARGV[0], ARGV[1] and ARGV[2] but you are only providing ARGV[0] and ARGV[1].
Therefore on line...
1,702
Posted By dexdex200
This should do it then: wc -l $filename |...
This should do it then:

wc -l $filename | awk '{ print $1"|"$2"|'${SOURCETYPE}'" }'

Bipinajith's code is neater though
1,702
Posted By dexdex200
This is in the spirit of what you tried. It...
This is in the spirit of what you tried. It should work:

wc -l $filename | awk '{ print $1"|"$2"|"'${SOURCETYPE}' }'>>$AUDITFILENAME
2,144
Posted By dexdex200
Hi Vicky5, You can use an expect script to...
Hi Vicky5,
You can use an expect script to achieve this. Here is a simplified one:


#!/bin/bash

/usr/bin/expect <<EOD

spawn Command1
set timeout 3600
expect {
eof { exit 0 } ...
2,144
Posted By dexdex200
If your requirement is to determine how long it...
If your requirement is to determine how long it takes the command to run then decide to exit whether it exceed 1 hr or not then:

starttime=`date "+%s"`
Command1
endtime=`date "+%s"`...
2,598
Posted By dexdex200
cat X1.txt X2.txt >> AllXfile.txt
cat X1.txt X2.txt >> AllXfile.txt
2,707
Posted By dexdex200
if you redirect the output of ls into a file it...
if you redirect the output of ls into a file it seems to always add the name of the file you redirected into the output.
You can try this:


ls|sort | grep -v mylisting > mylisting


I think...
1,908
Posted By dexdex200
Provide sample input and target files.
Provide sample input and target files.
Forum: Cybersecurity 01-28-2013
2,861
Posted By dexdex200
You should insert another rule to block incoming...
You should insert another rule to block incoming traffic from the internet to port 3124 above
iptables -A INPUT -p tcp --dport 3124 -j ACCEPT

eg:

iptables -A INPUT -i eth0 -p tcp --dport 3124...
1,605
Posted By dexdex200
You can achieve this with eval. Try this: ...
You can achieve this with eval.
Try this:


head -1 sample.txt > header.txt
field_count=`head -1 sample.txt | tr -dc '\t' | wc -c`
field_count=`expr $field_count + 1`
i=1
while [ $i -lt...
5,988
Posted By dexdex200
You may experience this if spaces exist in the...
You may experience this if spaces exist in the filenames.
Try this:

files=/home/david/files.txt
while read file; do
chmod 640 "${file}"
done < ${files}
Showing results 1 to 17 of 17

 
All times are GMT -4. The time now is 02:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy