how do I chop of characters at the end of a line...

トップ ページ
添付ファイル:
Eメールのメッセージ
+ (text/plain)
このメッセージを削除
このメッセージに返信
著者: Scott
日付:  
題目: how do I chop of characters at the end of a line...
You could do something like this:

a="string.txt"
new_a=`echo $a | cut -f1 -d.`

new_a would then only contain "string".

On 3 Mar 2003, Entelin wrote:

> I want to take a variable say a="string.txt" and chop off the last 4
> characters so I can make variable b equal to just "string"
>
> Thanks for your help
>
> ---------------------------------------------------
> PLUG-discuss mailing list -
> To subscribe, unsubscribe, or to change you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>


--
NT makes anything simple, easy, and anything difficult to do, impossible.
Unix makes anything easy to do difficult, and anything difficult to do,
possible. Basically, if your VCR is still flashing "12:00" then unix is not
for you!