How to change the login shell?
Answer:
To change the current user login shell, use the following command
e.g. change to /bin/sh
chsh -s /bin/sh
Logout and login again.
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
How to change the login shell?
Answer:
To change the current user login shell, use the following command
e.g. change to /bin/sh
chsh -s /bin/sh
Logout and login again.
Run all scripts under in a directory
Answer:
Create the following bash script, and execute it
for FILE in /project/scripts/*.sh
do
if [-f $FILE -a -x $FILE]
then
$FILE
fi
done
How to mass rename file in Bash
Answer:
For example, you might want to rename *.htm to *.html, create the following scripts
vi rename.sh
And enter
#!/bin/bash
for f in *.htm; do
mv $f ${f%htm}html
done
Execute the script and it does all the rename magics.
Convert IP address to HEX in Bash script
Answer:
The following Bash script is useful to convert IP address to HEX
#!/bin/sh
IP_ADDR=192.168.1.234
printf '%02X' ${IP_ADDR//./ }; echo
How to make shell script run in low priority
Answer:
At the top of your shell script, add the following line (renice 19 -p $$)
#!/bin/sh
renice 19 -p $$
...