"Fossies" - the Fresh Open Source Software Archive

Member "xorriso-1.5.4/releng/change_shell_to_use" (14 Aug 2011, 977 Bytes) of package /linux/misc/xorriso-1.5.4.pl02.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 
    2 # check whether we are in releng and create dir
    3 mkdir_ret=29
    4 if test -d releng_generated_data
    5 then
    6   if test -d releng_generated_data/change_shell_to_use
    7   then
    8     mkdir_ret=0
    9   else
   10     mkdir releng_generated_data/change_shell_to_use
   11     mkdir_ret=$?
   12   fi
   13 fi
   14 
   15 if test "$mkdir_ret" = 0
   16 then
   17   for i in run_all_auto auto_* manual_*
   18   do
   19     temp=releng_generated_data/change_shell_to_use/temp_file
   20     c=$(wc -l "$i" | awk '{print $1}')
   21     line=$(head -n 1 "$i")
   22 
   23     if echo x"$line" | grep '^x#!' >/dev/null 2>&1
   24     then
   25       cp "$i" "$temp"
   26       echo '#!'"$SHELL" > "$temp"
   27       tail -n "$(expr $c - 1)" "$i" >> "$temp"
   28       mv "$temp" "$i"
   29       echo "Changed to #!$SHELL : $i"
   30     fi
   31   done
   32   rmdir releng_generated_data/change_shell_to_use
   33 else
   34   echo "change_shell_to_use: Missing directory ./releng_generated_data" >&2
   35   echo "or cannot create directory ./releng_generated_data/change_shell_to_use" >&2
   36   echo "change_shell_to_use: Run aborted"
   37   test 1 = 0
   38 fi
   39