Search Results

Search: Posts Made By: faltooweb
1,574
Posted By faltooweb
"kill -9" cannot be trapped. ...
"kill -9" cannot be trapped.

-Ramesh
7,629
Posted By faltooweb
The above solution will work most of the time. It...
The above solution will work most of the time. It will give issues when the the data crosses over a year.
You may try the following, it does not rely on date to get the changes:
Assumption:...
1,759
Posted By faltooweb
Yes, you can. This is one way you can run from...
Yes, you can.
This is one way you can run from anywhere without changing the script or the current directory location.
If your script is at "dir1" and called "test.sh" then you can run as follows:...
85,802
Posted By faltooweb
ksh - how to echo something in color and bold
Here are the color codes and others:

LF="\n"; CR="\r"
INVT="\033[7m"; NORM="\033[0m"; BOLD="\033[1m"; BLINK="\033[5m"
#UNDR="\033[2m\033[4m"; EOL="\033[0K"; EOD="\033[0J"...
12,409
Posted By faltooweb
Problem with double quote and string variable
Here is a quick fix for your script

LIST=$(tail -1 $FILE)
cvs log -N -r$rev1:$rev2 $(eval $LIST) > changelog.txt

-Ramesh
2,848
Posted By faltooweb
Append line based on fixed position
awk '
/^1/ { s=$0 }
/^3/ {
if ( s == "" ) next
printf "%-21s%s\n",s,$0
s=""
}
' $INFILE

-Ramesh
10,113
Posted By faltooweb
converting config file to csv format
awk '
BEGIN { print "host,parent" }
/host_name/ {printf "%s,",$NF; getline; print $NF}
' $INFILE

-Ramesh
7,651
Posted By faltooweb
extract multiple sections of file
#-- Use ST values as output filename.
awk -v out="/dev/null" '
/^ST/ {gsub("\\*","-",$0); out=$0".txt"}
/^SE/ { close(out) }
{ printf "%s\n",$0 >> out }
' $INFILE

Output will be...
39,093
Posted By faltooweb
bash script to check the first character in string
This will work in bash/korn/baurne

str="$*"

case $str in
a*) echo "a found" ;;
*) echo " no a" ;;
esac
14,811
Posted By faltooweb
How to get the Previous month in Korn Shell
Try this.
#!/bin/ksh

curmth=`date +%m`
set -A mth Dec Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
prevmth=${mth[$((curmth - 1))]}
echo $prevmth

# end of file #

-Ramesh
22,693
Posted By faltooweb
I found this while searching for fast filename...
I found this while searching for fast filename expansion ideas.

I know this is very old message, but thought it should be put to a close.
Here is one way to achieve the result.

ls -rt...
Showing results 1 to 11 of 11

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