Zdravím, snažím se přinutit sed, aby vytisknul poslední znak v řetězci. Na linuxu mi funguje
echo "this is Sparta" | sed 's/\(.*\)\(.$\)/\2/'
a
Na solarisu mi ovšem ten samý příkaz hodí zpět celý řetězec
echo "this is Sparta" | sed 's/\(.*\)\(.$\)/\2/'
this is Sparta
Myslel jsem si, že problém bude část .* a zkoušel použít znak +, ale bez úspěchu. Poradil by někdo? :)
|   | 2 |  retagged  | 
Zdravím, snažím se přinutit sed, aby vytisknul poslední znak v řetězci. Na linuxu mi funguje
echo "this is Sparta" | sed 's/\(.*\)\(.$\)/\2/'
a
Na solarisu mi ovšem ten samý příkaz hodí zpět celý řetězec
echo "this is Sparta" | sed 's/\(.*\)\(.$\)/\2/'
this is Sparta
Myslel jsem si, že problém bude část .* a zkoušel použít znak +, ale bez úspěchu. Poradil by někdo? :)
 Copyright students of FIT CTU and others, 2014. Content on this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International license.
 
                
                Copyright students of FIT CTU and others, 2014. Content on this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International license.