Changeset 911 in MondoRescue
- Timestamp:
- Nov 1, 2006, 7:46:51 PM (17 years ago)
- Location:
- branches/stable
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/contrib/mkcd/setup
r355 r911 150 150 fi 151 151 152 res=`cat /etc/issue.net 2>/dev/null | fgrep -i turbolinux | head -n1`152 res=`cat /etc/issue.net 2>/dev/null | grep -i turbolinux | head -n1` 153 153 if [ "$res" != "" ] ; then 154 154 echo "$res" … … 156 156 fi 157 157 158 for fname in `find /etc -maxdepth 1 | fgrep release` /etc/issue.net ; do159 res=`cat $fname 2>/dev/null | fgrep -i "linux" | head -n1 | tr -s '\t' ' '`158 for fname in `find /etc -maxdepth 1 | grep release` /etc/issue.net ; do 159 res=`cat $fname 2>/dev/null | grep -i "linux" | head -n1 | tr -s '\t' ' '` 160 160 [ "$res" = "" ] && res=`cat $fname |head -n1 | tr -s '\t' ' '` 161 161 if [ "$res" != "" ] ; then … … 230 230 [ "`echo "$i" | grep mindi`" ] && qq=head || qq=tail 231 231 j=`find $1/ -type f -maxdepth 1 | grep "$i" | $qq -n1` 232 [ ! "$j" ] && j=`find RPMS/ -type f -maxdepth 1 | fgrep"$i" | $qq -n1`232 [ ! "$j" ] && j=`find RPMS/ -type f -maxdepth 1 | grep -F "$i" | $qq -n1` 233 233 if [ ! "$j" ] ; then 234 234 echo "Looking for $i" >> /dev/stderr … … 254 254 if echo "$j" | grep "\-$blah" &> /dev/null ; then 255 255 k=`echo "$j" | cut -d'-' -f1,2` 256 if echo "$j" | grep - x "[A-Z,a-Z]*-[A-Z,a-Z]*-[A-Z,a-z]*-.*"&> /dev/null ; then256 if echo "$j" | grep -E '^[A-Z,a-Z]*-[A-Z,a-Z]*-[A-Z,a-z]*-.*$' &> /dev/null ; then 257 257 k=`echo "$j" | cut -d'-' -f1,2,3` 258 258 fi … … 279 279 # echo "banner = $banner" >> /dev/stderr 280 280 for i in $banner ; do 281 j=`echo $i | grep - x "[v|V][0-9]+*.*"`282 [ ! "$j" ] && j=`echo $i | grep - x "[0-9]+*.*"`283 echo "$j" | grep - x "[0-9]*)"> /dev/null && continue281 j=`echo $i | grep -E '^[v|V][0-9]+*.*$'` 282 [ ! "$j" ] && j=`echo $i | grep -E '^[0-9]+*.*$'` 283 echo "$j" | grep -E '^[0-9]*)$' > /dev/null && continue 284 284 [ "$j" ] && res=`echo $j | sed s/v// | sed s/V//` 285 285 done … … 610 610 611 611 StrStr() { 612 [ "`echo "$1" | fgrep -i "$2"`" ] && return 0 || return 1612 [ "`echo "$1" | grep -Fi "$2"`" ] && return 0 || return 1 613 613 } 614 614 … … 674 674 echo -en "Do you want to install the (S)table or the (D)evelopment branch of Mondo? " 675 675 read ch 676 if [ "`echo "development" | fgrep -i "$ch"`" ] ; then676 if [ "`echo "development" | grep -Fi "$ch"`" ] ; then 677 677 MY_BRANCH=$DEVEL_BRANCH 678 678 MINDI_BRANCH=1.1 … … 703 703 echo -en "Shall I do that (y/n)? " 704 704 read ch 705 if [ "`echo "YESyesYes" | fgrep"$ch"`" ] ; then705 if [ "`echo "YESyesYes" | grep -F "$ch"`" ] ; then 706 706 distro=RHT 707 707 version=7.2 -
branches/stable/mindi/analyze-my-lvm
r850 r911 94 94 allocation=`GetValueFromField $fname "LV Size"` 95 95 [ ! "`echo "$allocation" | grep "[k,m,g]"`" ] && allocation="$allocation"m 96 if echo "$allocation" | grep - x ".*g"> /dev/null 2> /dev/null ; then96 if echo "$allocation" | grep -E '^.*g$' > /dev/null 2> /dev/null ; then 97 97 val=`echo "$allocation" | sed s/g//` 98 98 allocation=`echo "$val" | awk '{c=$1; printf "%d", c*1024;}'`m … … 169 169 170 170 ListLvmDrivesAndPartitions() { 171 $LVMCMD vgdisplay -v 2> /dev/null | grep "PV Name" | sed 's/(#)//' | awk '{print $3}'171 $LVMCMD vgdisplay -v 2> /dev/null | grep "PV Name" | sed 's/(#)//' | awk '{print $3}' 172 172 } 173 173 -
branches/stable/mindi/aux-tools/sbin/calc-disk-size
r196 r911 28 28 # ---------------- main --------------- 29 29 30 if [ "$#" -ne "1" ] || [ "`echo "$1" |grep - x "/dev/[a-z]*"`" = "" ]; then30 if [ "$#" -ne "1" ] || [ "`echo "$1" |grep -E '^/dev/[a-z]*$'`" = "" ]; then 31 31 LogIt "calc-disk-size <device>" 1 32 32 exit 1 -
branches/stable/mindi/install.sh
r898 r911 35 35 36 36 ARCH=`/bin/arch` 37 echo $ARCH | grep - x "i[0-9]86"&> /dev/null && ARCH=i386 && locallib=$local/lib38 echo $ARCH | grep - x "x86_64"&> /dev/null && locallib=$local/lib6439 echo $ARCH | grep - x "ia64"&> /dev/null && locallib=$local/lib37 echo $ARCH | grep -E '^i[0-9]86$' &> /dev/null && ARCH=i386 && locallib=$local/lib 38 echo $ARCH | grep -E '^x86_64$' &> /dev/null && locallib=$local/lib64 39 echo $ARCH | grep -E '^ia64$' &> /dev/null && locallib=$local/lib 40 40 export ARCH 41 41 -
branches/stable/mindi/rootfs/sbin/init
r898 r911 239 239 [ -d "/proc/1" ] || mount -n /proc 240 240 LogIt "Kernel support found. Creating config file and starting devfsd" 241 conffile=`strings $loc | grep "devfsd.conf$"`241 conffile=`strings $loc | grep -E "devfsd.conf$"` 242 242 [ "$conffile" ] || conffile="/etc/devfsd.conf" 243 243 confpath=`echo $conffile | sed "s/\/devfsd\.conf$//"` -
branches/stable/mondo/src/common/libmondo-archive.c
r908 r911 736 736 strcpy(scratchdir, bkpinfo->scratchdir); 737 737 sprintf(tmp, 738 "echo '%s' | tr -s ' ' '\n' | grep - x '/dev/.*' | tr -s '\n' ' ' | awk '{print $0\"\\n\";}'",738 "echo '%s' | tr -s ' ' '\n' | grep -E '^/dev/.*$' | tr -s '\n' ' ' | awk '{print $0\"\\n\";}'", 739 739 bkpinfo->exclude_paths); 740 740 strcpy(devs_to_exclude, call_program_and_get_last_line_of_output(tmp)); … … 3884 3884 */ 3885 3885 sprintf(tmp, 3886 "grep 'afio: ' %s | sed 's/afio: //' | grep -v x '/dev/.*' >> /tmp/changed.files",3886 "grep 'afio: ' %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> /tmp/changed.files", 3887 3887 MONDO_LOGFILE); 3888 3888 system(tmp); 3889 3889 3890 3890 sprintf(tmp, 3891 "grep 'star: ' %s | sed 's/star: //' | grep -v x '/dev/.*' >> /tmp/changed.files",3891 "grep 'star: ' %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> /tmp/changed.files", 3892 3892 MONDO_LOGFILE); 3893 3893 system(tmp); -
branches/stable/mondo/src/common/libmondo-tools.c
r909 r911 625 625 strcpy(tmp, 626 626 call_program_and_get_last_line_of_output 627 ("free | grep \":\"| tr -s ' ' '\t' | cut -f2 | head -n1"));627 ("free | grep ':' | tr -s ' ' '\t' | cut -f2 | head -n1")); 628 628 avm += atol(tmp); 629 629 sprintf(command, "mount /dev/shm -t tmpfs %s -o size=%d%c", … … 1396 1396 log_msg(4, "Done. Great. Seeting command to something"); 1397 1397 strcpy(command, 1398 "grep -v \":\" /etc/fstab | grep -v x \"#.*\"| grep -E \"[ ]/boot[ ]\" | tr -s ' ' '\t' | cut -f1 | head -n1");1398 "grep -v \":\" /etc/fstab | grep -vE '^#.*$' | grep -E \"[ ]/boot[ ]\" | tr -s ' ' '\t' | cut -f1 | head -n1"); 1399 1399 log_msg(4, "Cool. Command = '%s'", command); 1400 1400 strcpy(tmp, call_program_and_get_last_line_of_output(command)); … … 1410 1410 } 1411 1411 } else { 1412 sprintf(command, "mount | grep -E \"^%s\"", tmp);1412 sprintf(command, "mount | grep -E '^%s'", tmp); 1413 1413 log_msg(3, "command = %s", command); 1414 1414 if (run_program_and_log_output(command, 5)) { … … 1486 1486 ("mktemp -q /tmp/mojo-jojo.blah.XXXXXX")); 1487 1487 if (does_file_exist(config_file)) { 1488 sprintf(command, "grep -v x '%s .*' %s > %s",1488 sprintf(command, "grep -vE '^%s .*$' %s > %s", 1489 1489 label, config_file, tempfile); 1490 1490 paranoid_system(command); -
branches/stable/mondo/src/common/libmondo-verify.c
r543 r911 165 165 log_msg(1, "Now scanning log file for 'afio: ' stuff"); 166 166 sprintf(command, 167 "grep \"afio: \" %s | sed 's/afio: //' | grep -v x \"/dev/.*\">> %s",167 "grep \"afio: \" %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> %s", 168 168 stderr_fname, afio_found_changes); 169 169 log_msg(2, command); … … 175 175 log_msg(1, "Now scanning log file for 'star: ' stuff"); 176 176 sprintf(command, 177 "grep \"star: \" %s | sed 's/star: //' | grep -v x \"/dev/.*\">> %s",177 "grep \"star: \" %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s", 178 178 stderr_fname, afio_found_changes); 179 179 log_msg(2, command); … … 1149 1149 (int) (random() % 32767)); 1150 1150 sprintf(tmp, 1151 "grep - x \"%s:.*\" %s | cut -d'\"' -f2 | sort -u | awk '{print \"/\"$0;};' | tr -s '/' '/' | grep -v \"(total of\" | grep -v \"incheckentry.*xwait\" | grep -vx \"/afio:.*\" | grep -vx \"dev/.*\"> %s",1151 "grep -E '^%s:.*$' %s | cut -d'\"' -f2 | sort -u | awk '{print \"/\"$0;};' | tr -s '/' '/' | grep -v \"(total of\" | grep -v \"incheckentry.*xwait\" | grep -vE '^/afio:.*$' | grep -vE '^dev/.*$' > %s", 1152 1152 (bkpinfo->use_star) ? "star" : "afio", MONDO_LOGFILE, 1153 1153 changed_files_fname); -
branches/stable/mondo/src/mondorestore/mondo-restore.c
r818 r911 3106 3106 fatal_error("This will fail"); 3107 3107 sprintf(command, 3108 "grep - x \"%s.*\"%s > %s",3108 "grep -E '^%s.*$' %s > %s", 3109 3109 restore_this_directory, g_filelist_full, g_filelist_full); 3110 3110 if (system(command)) { … … 3116 3116 fatal_error("This will fail"); 3117 3117 sprintf(command, 3118 "grep - x \"%s.*\"%s > %s",3118 "grep -E '^%s.*$' %s > %s", 3119 3119 restore_this_directory, g_biggielist_txt, g_biggielist_txt); 3120 3120 if (system(command)) { -
branches/stable/mondo/src/restore-scripts/mondo/make-me-bootable
r680 r911 42 42 partno=$root_part 43 43 else 44 driveline=`grep - w /boot$1`45 [ ! "$driveline" ] && driveline=`grep - w /$1`44 driveline=`grep -E '[ ]/boot[ ]' $1` 45 [ ! "$driveline" ] && driveline=`grep -E '[ ]/[ ]' $1` 46 46 partno=`echo "$driveline" | cut -d' ' -f1 | awk -F "[a-z]" '{print $NF;}'` 47 47 # echo "driveline=$driveline --> partno=$partno"
Note:
See TracChangeset
for help on using the changeset viewer.