Macに、Linuxの名前の変更をインストールすることができません

StackOverflow https://stackoverflow.com/questions/915174

  •  06-09-2019
  •  | 
  •  

質問

私が読んチュートリアルのutilの-linuxの時に実行するように私に助言ましたパッケージ

./configure

私が取得

configuring util-linux-2.12q

You don't have <scsi/scsi.h>
You don't have <linux/blkpg.h>
You don't have <linux/kd.h>
You have <locale.h>You have <langinfo.h>
You have <sys/user.h>
You have <uuid/uuid.h>
You have <rpcsvc/nfs_prot.h>
You don't have <asm/types.h>
You don't have <linux/raw.h>
You have <stdint.h>
You don't have <sys/io.h>
You have inet_aton()
You have fsync()
You have getdomainname()
You have nanosleep()
You don't have personality()
You don't have updwtmp()
You have fseeko()
You have lchown()
You don't have rpmatch()
You have <term.h>
You have ncurses. Using <ncurses.h>.
You have termcap
You don't need -lcrypt
Strange... Static compilation fails here.
You don't have native language support
You have __progname
You don't have <pty.h> and openpty()
You have wide character support
You don't have SYS_pivot_root
You have a tm_gmtoff field in struct tm
Your rpcgen output does not compile - using pregenerated code
You have zlib
You don't have blkid

これは、MISC-utilsの

で次のコマンドを実行するために私に助言します
make rename 

私は警告以下の取得

cc -pipe -O2 -mtune=i386 -fomit-frame-pointer -I../lib -Wall -Wmissing-prototypes -Wstrict-prototypes -DNCH=1   -D_FILE_OFFSET_BITS=64 -DSBINDIR=\"/sbin\" -DUSRSBINDIR=\"/usr/sbin\" -DLOGDIR=\"/var/log\" -DVARPATH=\"/var\" -DLOCALEDIR=\"/usr/share/locale\" -O2  -s  rename.c   -o rename
ld warning: option -s is obsolete and being ignored

をどのように名前を変更-command for Macのインストールができますか?

役に立ちましたか?

解決

これは警告ではなくエラーになります。

私はこの自分自身を試してみたのだが、名前変更の実行可能ファイルを構築しています。

他のヒント

Linuxからのrenameをコンパイルしてください。 チュートリアルの中の適応症にはいくつかのマイナーな違いがあります。私は、ファイル<のhref = "http://www.kernel.org/pub/linux/utils/util-linux/v2.22/util-linux-2.22.tar.gz" のrel = "nofollowをからバージョン2.22を使用しました「>のutil-linuxの-2.22.tar.gzする

それをダウンロードして解凍します。端末内の非圧縮フォルダに移動します。

ちょうど./configureを実行しないでください、代わりにフラグで、このコマンドを使用します:

./configure --disable-su --disable-sulogin --disable-login

その非常に同じフォルダから、に変化していないMISC-utilsの、あなたがmake rename

それはあなたがそれを必要とする場合、現在のフォルダ内の実行可能ファイルを持っているだろうとの男のドキュメントMISC-utilsの、すべてのです。

簡単に使用して名前の変更をインストール自作する

brew install rename

あなただけのmvをコンパイルしようとするのではなく、renameを使用することができませんか?多分それはrenameへのエイリアス?

(EDIT:ビルド必需品についての私のコメントを無視する - 襄陽するで指摘したように、それはそれのように見えますとにかくOK構築されている必要があります)。

これを試してください:

function rename { from=$1; to=$2; shift 2; for i in "$@"; do j=`echo $i | sed "s/$from/$to/"`; mv "$i" "$j"; done }

あなたの.profileまたは.bashrcの中にそれを貼り付け、ユーティリティの名前を変更するだけではRed Hatのようにそれを実行します。

$rename foo bar *.txt

はfoo1.txt、bar1.txtにfoo2.txtとfoofoo.txt、bar2.txtしかし、多少イライラ、barfoo.txtをオン。
たぶん誰かがこれを修正するためにそれを調整することができます。

それはそれらをせずに行いますすべての変更のリストを出力するように

「MV」の前に「エコー」を置くことによってそれをテストします。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top