2
votes
3answers
202 views

Year Month day from file name in shell script

I hava file names like below adn_DF9D_20140515_0001.log adn_DF9D_20140515_0002.log adn_DF9D_20140515_0003.log adn_DF9D_20140515_0004.log adn_DF9D_20140515_0005.log adn_DF9D_20140515_0006.log ...
0
votes
3answers
105 views

Exclude with the find command [duplicate]

I need some help getting the find command to work right in a script working on. I need to be able to exclude some directories. Below I have what I'm doing as a work around. sudo find / ( -name ...
-1
votes
1answer
97 views

Can not seem to get expr substr to work

Can anyone tell me what I am doing wrong ? [ /jlr/sub/libexec/vmr-staging ] $ expr substr "onetwothree" 1 4 expr: syntax error I got the syntax from http://stackoverflow.com/a/220464/1150847
0
votes
1answer
105 views

Recursively delete empty folders with verbose output

This should be fairly simple, but I am not sure what i'm missing. I'd like to recursively delete empty directories, and get an output for what's being deleted, this command works for sure, but I just ...
3
votes
1answer
152 views

echo $? doesn't work when executed remotely

When I execute a command as below it gives me an output as expected but when I run the same command on remote server it always gives me echo $? as 0. locally # <some command> # echo $? ...
-1
votes
1answer
210 views

shell script - while loop, handle the exception

I am running a shell script with a while loop and it exits with the below error, how could I avoid it or catch the error and let the loop to continue ? ie how could I handle the exception stty: ...
-4
votes
2answers
291 views

Check a list of passwords strength [closed]

Is there any way to check a list of passwords whether they strong or not? I have a list of passwords, around 2000, and want to check them against this policy Password must contain a minimum of ...
0
votes
1answer
163 views

How to make a Bash Script take user input for Changing a Password

The following command on OSX will change an Open Directory (Apple's LDAP) password. The $ is the prompt: $ dscl -u diradmin -P 'password' /LDAPv3/127.0.0.1 passwd /Users/username newpassword I ...
1
vote
3answers
3k views

Powershell Parameters

I have a Param block in my script Param ( [Parameter(Mandatory=$True)] [string]$FileLocation, [Parameter(Mandatory=$True)] [string]$password = Read-Host "Type the password you would ...
3
votes
3answers
608 views

Email to run a bash script

I have a bash script to restart a service that runs every 3am to guarantee that the service isn't crashed when users require it. However, I need to provide a simpler way for my partner (that isn't ...
0
votes
1answer
221 views

Running root script upon ssh'ing as a particular user, but not upon standard login

I would like to do the following : If I login as user ABC via the login screen, do nothing. However if I ssh as ABC, then I want to run a root script, without being prompted for roots password, and ...
0
votes
2answers
608 views

How can I script creating email aliases for existing mailboxes in Exchange 2003?

I need to create lots of email aliases (more than I want to do manually), so I want to know if there's a way I can script the addition of aliases to existing mailboxes/users. I don't mind if I have to ...
1
vote
2answers
212 views

Why is this bash script not working?

I'm making a bash script which checks the available space on disk: if [ check_space -gt "85" ]; then echo "removing" else echo "not removing" fi check_space returns a number like 52 and the ...
0
votes
3answers
116 views

listing file with for loop using array and if

I've written a script to check files in different directories and want this script to show me error in case a file does not exists. But It show me Both ERROR and NO ERROR due to loop. ow to adjust so ...
0
votes
2answers
109 views

How To Generate A Report Of All Messages Triggering A Specific NDR

CENTOS 5.x | Sendmail Hello All, I hope this is a simple question. =) I need to generate a report summary of messages that triggered a specific DSN code. For example: Jan 11 07:43:34 ...