0
votes
1answer
36 views

Answer password prompt programmatically via shell script

I would like to programmatically answer a password prompt using only shell script when prompted. Is it possible to automate this task in this way? I want to avoid other tools entirely - so no expect ...
5
votes
2answers
444 views

How to stop Fork Bomb out of memory error - RHEL 6

I set up test VM to test the effect of fork bombs. So I edited the limits.conf as follows for root user: root hard nproc 512 Now I drop a fork bomb like so: :(){ :|:& };: After ...
1
vote
3answers
226 views

How to add Multiple Searches in AWK command

Im trying to search for the files Created in June,July and August months. I used this method ls -lrth|awk '/[Jun][Jul][Aug]/ {print}' but it ain't working. Please help me correct the syntax.
2
votes
2answers
625 views

how to add line in a /etc/sudoers file with the help of shell script (50servers)?

Anyone can help me with shell script, I want to know script which can edit /etc/sudoers file and let me add {{{{{userid ALL=(root) ALL}}}} to 50 server I have on same network?
3
votes
1answer
1k views

Installing ksh as the standard shell in Redhat: Foolhardy?

I'm not a system administrator, but my organization is considering replacing /bin/sh in Red Hat Enterprise Linux 6+ with a hard link to /bin/ksh. How foolhardy would this be? The background to this ...
2
votes
1answer
78 views

Message appears after every command completed

I am very new to Linux. Having said this, I had a friend go on my RHEL machine and he somehow added a few random lines in a file, which will post every time I have completed a command. I am not sure ...
5
votes
2answers
2k views

How to continuously take backup of log files?

I have some applications in Lunux which creates Log files of around 41 MB each. The log files switches from log.1 to log.2 and starts overwriting log.2 once this 41MB is completed in log.1 file. I ...
7
votes
2answers
5k views

/dev/tcp listen instead of nc listen

With a netcat listener like: nc -l <port> < ~/.bashrc I can grab my .bashrc on a new machine (doesn't have nc or LDAP) with: cat < /dev/tcp/<ip>/<port> > ~/.bashrc My ...
2
votes
0answers
78 views

How to get environment variables to persist across login? [duplicate]

Possible Duplicate: How do I set a user environment variable? (permanently, not session) For a project I'm working on, I have a service that runs at startup which calls a script to set ...
5
votes
4answers
1k views

Selinux is denying access to mysqld

I have a script that dumps a mysql database. It then compresses the file and this gets stored in my home folder by using cron. The problem is I seem to be getting an error message. mysqldump: ...
6
votes
1answer
2k views

Why does redirection (>) not work sometimes but appending (>>) does?

While studying for the RHCE, I came across a situation where stdin redirection does not work in bash: # file /tmp/users.txt /tmp/users.txt: cannot open `/tmp/users.txt' (No such file or directory) ...
3
votes
5answers
1k views

Does $SHELL store the path to the default shell in Linux?

My administrator says that my default shell is set to bash, but $ echo $SHELL /bin/csh $ Is the default shell related to the SHELL variable at all? Is not, what is the variable used for?