$ cat filename.txt
ABCDEFG
First of all the most complex way is using sed
$ cat filename.txt | sed 's/\(.*\)/\L\1/g'
abcdefg
More easier to use tr
$ cat filename.txt | tr [:upper:] [:lower:]
abcdefg
$ cat filename.txt
ABCDEFG
$ cat filename.txt | sed 's/\(.*\)/\L\1/g'
abcdefg
$ cat filename.txt | tr [:upper:] [:lower:]
abcdefg
1 #!/usr/bin/expect -f
2
3 set timeout 1
4
5 set username [lindex $argv 0]
6 set password [lindex $argv 1]
7 set host_filename [lindex $argv 2]
8 set new_dir [lindex $argv 3]
9
10 eval spawn scp $username@$host_filename $new_dir
11
12 expect "password: $"
13 send "$password\n"
14
15 expect "$ $"
1 #!/bin/bash
2
3 var=''
4
5 if [ -z ${var} ]; then
6 echo "ZERO"
7 else
8 echo "NOT ZERO"
9 fi
10
11 if [ -n ${var} ]; then
12 echo "NOT ZERO"
13 else
14 echo "ZERO"
15 fi
16
ZERO
ZERO
ZERO
NOT ZERO
1 #!/bin/bash
2
3 var=''
4
5 if [ -z "${var}" ]; then #we do make sure it's string
6 echo "ZERO"
7 else
8 echo "NOT ZERO"
9 fi
10
11 if [ -n "${var}" ]; then # ... and here
12 echo "NOT ZERO"
13 else
14 echo "ZERO"
15 fi
16
#!/bin/sh
. /etc/rc.d/init.d/functions
# Location of a non-daemon application to be daemonized
BIN="/usr/local/bin/hello_world"
# The username to run the process with
RELUSER="aolehnovich"
# Our PID file
PIDFILE="/var/run/hello_world.pid"
# Log file location
LOGFILE="/var/log/hello_world.log"
start()
{
rm -f $LOGFILE
# Execute ourself in a background mode
su -l $RELUSER -p -c "${0} start_internal &"
echo -n "Starting Application: "
success "Starting Application: "
echo
}
start_internal()
{
# Remember PID
echo "$$" > $PIDFILE
# Exec the non-daemon application
exec "$BIN" > $LOGFILE
}
stop()
{
if [ -f ${PIDFILE} ]; then
kill `cat $PIDFILE`
rm -f $PIDFILE
echo -n "Stopping Application: "
success "Stopping Application: "
echo
fi
}
case "$1" in
start)
start
;;
start_internal)
start_internal
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage $0 {start|stop|restart}"
exit 1
esac
exit 0
# rpmbuild --rebuild php-5.1.6-3.src.rpm
...
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.
error: Bad exit status from /var/tmp/rpm-tmp.37368 (%build)
# rpm -ihv php-5.1.6-3.src.rpm
# vim /usr/src/redhat/SPECS/php.spec
CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -Wno-pointer-sign"
# rpmbuild -bb /usr/src/redhat/SPECS/php.spec
# rpm -Uhv /usr/src/redhat/RPMS/x86_64/php*