Search Results

Search: Posts Made By: rajivn786
1,292
Posted By RudiC
Is the dot to be included? Try pure...
Is the dot to be included? Try pure bash:var=./dir1/file1/abc.sh
echo ${var%/*}
./dir1/file1
1,292
Posted By vgersh99
many ways to skin that cat: echo...
many ways to skin that cat:

echo './dir1/file1/abc.sh' | sed 's#/[^/][^/]*$##'
3,481
Posted By Corona688
wc -c, not wc -m. For ASCII text, you want...
wc -c, not wc -m. For ASCII text, you want bytes. The difference is small but important.

wc will include the line feed in the length, yes.
3,481
Posted By Corona688
That's pretty close, really. Use wc -c to...
That's pretty close, really.

Use wc -c to print the number of characters instead of lines.
Showing results 1 to 4 of 4

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