Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. sed -i '1s/^/<!DOCTYPE html> n/' ${file_name.html}
  2.  
  3. sed -i '' '1s/^/<!DOCTYPE html> n/' ${file_name.html}
  4.  
  5. sed -i.bak -e '…' SOMEFILE
  6.  
  7. case $(sed --help 2>&1) in
  8. *GNU*) set sed -i;;
  9. *) set sed -i '';;
  10. esac
  11. "$@" -e '…' "$file"
  12.  
  13. case $(sed --help 2>&1) in
  14. *GNU*) sed_i () { sed -i "$@"; };;
  15. *) sed_i () { sed -i '' "$@"; };;
  16. esac
  17. sed_i -e '…' "$file"
  18.  
  19. perl -i -pe '…' "$file"
  20.  
  21. sed -e '…' "$file" >"$file.new"
  22. mv -- "$file.new" "$file"
  23.  
  24. sed '1s/^/<!DOCTYPE html> n/' "${file_name.html}" > "${file_name.html}.tmp" &&
  25. mv "${file_name.html}.tmp" "${file_name.html}"
  26.  
  27. perl -i -pe 'print "<!DOCTYPE html> n" if $.==1;' "${file_name.html}"
  28.  
  29. $ printf '0an<!DOCTYPE html>n.nwn' | ed my.html
  30.  
  31. $ sed -i '1i<!DOCTYPE html>n` testfile.csv
  32.  
  33. { rm -f file && { echo '<!DOCTYPE html>'; cat; } > file;} < file
  34.  
  35. sed '1i
  36. <!DOCTYPE html>' file 1<> file
  37.  
  38. echo a > testfile.txt
  39. ls -li testfile.txt
  40. #gsed -i -e 's/a/A/' testfile.txt
  41. #bsdsed -i 's/a/A/' testfile.txt # does not work
  42. bsdsed -i -e 's/a/A/' testfile.txt
  43. ls -li testfile.txt
  44. cat testfile.txt
  45.  
  46. printf '%sn' 1i '<!DOCTYPE html>' . x | ex file
  47.  
  48. sed 'script' <<FILE >file
  49. $(cat file)
  50. FILE
  51.  
  52. sed 'script' <<FILE >file
  53. $(tee file.old <file)
  54. FILE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement