سؤال

قرأت ال الدورة التعليمية الذي ينصحني بالركض في حزمة 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 لنظام التشغيل Mac؟

هل كانت مفيدة؟

المحلول

هذا تحذير، وليس خطأ.

لقد جربت هذا نفسي، وقد بنى إعادة تسمية قابل للتنفيذ.

نصائح أخرى

هل تجميعها rename من لينكس. هناك بعض الاختلافات الطفيفة في المؤشرات في الدورة التعليمية. وبعد لقد استخدمت الإصدار 2.22 من الملف Util-Linux-2.22.tar.gz

قم بتنزيله وإلغاء ضغطه. انتقل إلى المجلد غير المضغوط في محطة.

لا تدير فقط ./configure, ، استخدم هذا الأمر مع الأعلام بدلا من ذلك:

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

ثم من هذا المجلد نفسه، لا يتغير في Misc-Utils، تقوم بذلك make rename

هذا كل شيء، في المجلد الحالي، سيكون لديك الملف القابل للتنفيذ وفي MISC-UTILS THE MAN Documentation إذا كنت في حاجة إليها.

تثبيت بسهولة إعادة تسمية باستخدام البيرة

brew install rename

لا يمكنك فقط استخدام mv بدلا من محاولة ترجمة renameب ربما حتى الاسم المستعار rename?

(تحرير: تجاهل تعليقي حول الإنشاء - كما أشار من قبل يانغ يانغ, ، يبدو أنه كان ينبغي أن يكون قد بنيت موافق على أي حال)

جرب هذا:

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 وتشغيله تماما مثل أداة إعادة تسمية القبعة الحمراء:

$rename foo bar *.txt

ينقلب foo1.txt، foo2.txt و foofoo.txt إلى bar1.txt، bar2.txt ولكن، إلى حد ما، barfoo.txt.
ربما يمكن لشخص ما تعديله لإصلاح هذا.

اختبره عن طريق وضع "صدى" قبل "MV" بحيث يخرج قائمة بجميع التغييرات التي سيجعلها دون جعلها.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top