|
|
25 Oct 2008 08:20:14 am |
MAC: create control or Window without NIB |
|
|
Just see a way to create button by code. Very interested in create Mac application purely by code and without anything from IB.
http://www.cocoadev.com/index.pl?NSButton
For Window and how an application load an window without an NIB, see this one,
http://objectmix.com/c/177994-how-create-windows-without-nib.html
Code :
int main(int argc, char *argv[])
{
NSWindow *mainwin;
MainView *mainview;
NSRect scr_frame;
unsigned int style_mask;
NSAutoreleasePool *pool =[[NSAutoreleasePool alloc] init];
[NSApplication sharedApplication];
scr_frame=[[NSScreen mainScreen] visibleFrame];
style_mask=NSClosableWindowMask|NSMiniaturizableWi ndowMask|
NSResizableWindowMask|NSTitledWindowMask;
#ifdef GNUSTEP
scr_frame=[NSWindow frameRectForScreenRect:scr_frame styleMask:style_mask];
#endif
scr_frame=[NSWindow contentRectForFrameRect:scr_frame
styleMask:style_mask];
mainwin=[[NSWindow alloc]
initWithContentRect:scr_frame
styleMask:style_mask
backing:NSBackingStoreBuffered
defer:NO];
[mainwin makeKeyAndOrderFront:nil];
[mainwin setTitle:@"Visible screen window"];
mainview=[[MainView alloc] initWithFrame:scr_frame];
[mainwin setContentView:mainview];
[mainwin setReleasedWhenClosed:YES];
[pool release];
[NSApp run];
return 0;
}
|
|
| |
Category : IPhone
| Posted By : Eric Shan | Comments[0] | Trackbacks [0] |
|
|
|
03 Jun 2008 02:47:04 am |
Winchain installation |
|
|
用WinChain来装Iphone toolchain也是挺省力的事情,下载pretoolchain完后,解压,运行WinChain.1.1,觉得它就是把pretoolchain rename成Cygwin, 然后下载安装一下cgywin,装default的pack.
同样的过程在公司安装就是无法编译,最后发现\usr\local\arm-apple-darwin\include\stdint.h这个link不对了,用\usr\local\arm-apple-darwin\include\gcc\darwin\4.0替换掉. |
|
| |
Category : IPhone
| Posted By : Eric Shan | Comments[0] | Trackbacks [0] |
|
|
|
28 May 2008 12:57:57 am |
Iphone firmwares |
|
|
http://tungchingkai.blogspot.com/2008/01/decrypt-iphone-filesystem-firmware.html
(1) For Firmware 1.0.1
(i) get the vfdecrypt101.exe from Rapid share(http://rapidshare.com/files/63681184/vfdecrypt101.exe.html)
(ii) get the Apple's iPhone firmware 1.0.1 and rename it with extension .zip and unzip it
(run) vfdecrypt101 main_dmg_of_101.dmg decrypted101.dmg
(2) For Firmware 1.0.2
(i) get the vfdecrypt102.exe from Rapid share(http://rapidshare.com/files/58198544/vfdecrypt102.exe.html)
(ii) get the Apple's iPhone firmware 1.0.2 and rename it with extension .zip and unzip it
(run) vfdecrypt102.exe 694-5298-5.dmg decrypted102.dmg
(3) For Firmware 1.1.1
(i) get the vfdecrypt111.exe from Rapid share(http://rapidshare.com/files/63677864/vfdecrypt111.exe.html)
(ii) get the Apple's iPhone firmware 1.1.1 and rename it with extension .zip and unzip it
(run) vfdecrypt111.exe 022-3602-17.dmg decrypted111.dmg
(4) For Firmware 1.1.2
(i) get the vfdecrypt112.exe from Rapid share(http://rapidshare.com/files/68797940/vfdecrypt112.exe.html)
(ii) get the Apple's iPhone firmware 1.1.2 and rename it with extension .zip and unzip it
(run) vfdecrypt112.exe 022-3725-1.dmg decrypted112.dmg
(5) For Firmware 1.1.3(http://rapidshare.com/files/41004473/vfdecrypt.exe.html)
(i) get the vfdecrypt.exe from Rapid Share
(ii) get the Apple's iPhone firmware 1.1.3 and rename it with extension .zip and unzip it
(run) vfdecrypt -i 022-3743-100.dmg -o decrypted113.dmg -k 11070c11d93b9be5069b643204451ed95aad37df7b332d10e48fd3d23c62fca517055816
(6) For Firmware 1.1.4
(i) get the vfdecrypt.exe from Rapid Share
(ii) get the Apple's iPhone firmware 1.1.4 and rename it with extension .zip and unzip it
(run) vfdecrypt -i 022-3894-4.dmg -o decrypted114.dmg -k d0a0c0977bd4b6350b256d6650ec9eca419b6f961f593e74b7e5b93e010b698ca6cca1fe
(7) For Firmware 2.0 beta (Build 5A225c) (MD5 8254ccf38735bc74b38fb432ce982081) expired 8 April 2008
(i) Google Search iPhone1,1_2.0_5A225c_Restore.ipsw
(ii) Rename it with extension .zip and unzip it
(run) vfdecrypt -i 018-3473-4.dmg -o decrypted20b2.dmg -k ea14f3ec624c7fdbd52e108aa92d13b16f6b0b940c841f7bbc7792099dae45da928d13e7
(8 ) For Firmware 2.0 beta (Build 5A240d) (MD5 429142d57db7cf94d4c29ee4da7f21cc) (to be expired 15 May 2008 )
(i) Google Search iPhone1_1_2.0_5A240d_Restore.ipsw
(ii) Rename it with extension .zip and unzip it
(run) vfdecrypt -i 018-3553-6.dmg -o decrypted20b3.dmg -k e24bfab40a2e5d3dc25e089291846e5615b640897ae8b424946c587bcf53b201a1041d36
(9) For Firmware 2.0 beta (Build 5A258f) (MD5 f7a2937c32615545ba339c330356d9ad) (to be expired 4 June 2008 )
(i) Google Search iPhone 2.0 Beta 4 (5a258f)
(ii) Rename it with extension .zip and unzip it (unzip -o iPhone1,1_2.0_5A258f_Restore.ipsw 018-3585-6.dmg)
(run) vfdecrypt -i 018-3585-6.dmg -o decrypted20b4.dmg -k 198d6602ba2ad2d427adf7058045fff5f20d05846622c186cca3d423ad03b5bc3f43c61c
For vfdecrypt.exe,
libeay32.dll
http://pecl4win.php.net/download.php/dll/061dae89b309a98382dedc04942bd8a2/libeay32.dll
To extract the contents in the dmg image in PC you need hfsexplorer(plus java runtime) or dmg2img.exe
http://hem.bredband.net/catacombae/hfsx.html
http://devices.natetrue.com/iphone/ibrickr-jb113.zip
http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jre-6u4-windows-i586-p-iftw.exe?BundledLineItemUUID=H25IBe.l.7oAAAEX_wIJ2rG5&OrderID=wqFIBe.lQkEAAAEX9AIJ2rG5&ProductID=lr9IBe.nFxoAAAEWAhINQrEN&FileName=/jre-6u4-windows-i586-p-iftw.exe
You can also use PowerISO 4.0 in Windows to examine and extract contents of Mac OS X *.dmg file
http://www.poweriso.com/
You can mount the decrypted image directly in Mac OS or Linux. To mount DMG
dd if=694-5259-38.dmg of=ramdisk.dmg bs=512 skip=4 conv=sync
mount -o loop decrpyted112.img /mnt/decrypted112
Keys
The key for the 1.01 revision is : 28c909fc6d322fa18940f03279d70880e59a4507998347c70d5b8ca7ef090ecccc15e82d
The key for the 1.02 revision is : 7d5962d0b582ec2557c2cade50de90f4353a1c1de07b74212513fef9cc71fb890574bfe5
The key for the 1.1.1 revision is : f45de7637a62b200950e550f4144696d7ff3dc5f0b19c8efdf194c88f3bc2fa808fea3b3
The key for the 1.1.2 revision is :
70e11d7209602ada5b15fbecc1709ad4910d0ad010bb9a9125b78f9f50e25f3e05c595e2
The key for the 1.1.3 revision is :
11070c11d93b9be5069b643204451ed95aad37df7b332d10e48fd3d23c62fca517055816
The key for the 1.1.4 revision is : d0a0c0977bd4b6350b256d6650ec9eca419b6f961f593e74b7e5b93e010b698ca6cca1fe
The key for the 1.2.0 beta (Build 5A147p) (md5 iPhone1,1_1.2_5A147p_Restore.ipsw = 3539f0b912812fd56ac1019d8fce4fc2 ) is: 86bec353ddfbe3fb750e9d7905801f79791e69acf65d16930d288e697644c76f16c4f16d
The key for the 2.0 beta (Build 5A225c) (md5 iPhone1,1_2.0_5A225c_Restore.ipsw = 8254ccf38735bc74b38fb432ce982081 ) is: ea14f3ec624c7fdbd52e108aa92d13b16f6b0b940c841f7bbc7792099dae45da928d13e7
The key for the 2.0 beta (Build 5A240d) (md5 iPhone1_1_2.0_5A240d_Restore.ipsw = 429142d57db7cf94d4c29ee4da7f21cc) is: e24bfab40a2e5d3dc25e089291846e5615b640897ae8b424946c587bcf53b201a1041d36
The key for the 2.0 beta (Build 5A258f) (md5 iPhone1,1_2.0_5A258f_Restore.ipsw = f7a2937c32615545ba339c330356d9ad) is: 198d6602ba2ad2d427adf7058045fff5f20d05846622c186cca3d423ad03b5bc3f43c61c
The key for the 2.0 beta (Build 5A274d) (md5 iPhone1,1_2.0_5A274d_Restore.ipsw = 1e671faa31d876602161d9bb463e15da) is: 589df25eaa4ff0a5e29e1425fb99bf50957888ff098ba2fcb72cf130f40e15e00bcf2fc7
Regarding how to find the key:
Read this on how to find the key for firmware 1.1.1 or above
For example, firmware 1.1.4, you can find the decrypt key by running this in Mac OS X Terminal
#!/bin/bash# first extract the ramdisk image file from the ipsw fileunzip -o iPhone1,1_1.1.4_4A102_Restore.ipsw 022-3896-4.dmg -d .# strip off the first 0x800 bytes and the trailing certificatedd if=022-3896-4.dmg of=022-3896-4.stripped.dmg bs=512 skip=4 count=36640 conv=sync# use the method of GEORGE HOTZ and ignore the erroropenssl enc -d -in 022-3896-4.stripped.dmg -out ramdisk-022-3896-4.dmg -aes-128-cbc -K 188458A6D15034DFE386F23B61D43774 -iv 0# print out the ramdisk key from the imagestrings ramdisk-022-3896-4.dmg | egrep "^[0-9a-fA-F]{72}$"
If you have the 8900decryptor binary, you can get the same decrypted image file and key from
#!/bin/bash./8900decryptor 022-3896-4.dmg 022-3896-4.8900decrypted.dmgstrings 022-3896-4.8900decrypted.dmg | egrep "^[0-9a-fA-F]{72}$" |
|
| |
Category : IPhone
| Posted By : Eric Shan | Comments[0] | Trackbacks [0] |
|
|
|
27 May 2008 07:24:19 am |
在Apple官方的Xcode上编译1.1.4的app |
|
|
http://www.hackint0sh.org/forum/showthread.php?t=37998
Lets use all power of graphic IDE from Apple SDK for 1.1.4 development:
0. Close XCode and make sure its not running
1. Download installation:
-For SDK v1 http://r_apidshare.com/files/102531763/sdk_mod.tgz.html (remove _ )
-For SDK v2 http://r_apidshare.com/files/1030589...2_mod.tgz.html (remove _ )
-For SDK v3 http://r_apidshare.com/files/1081397...3_mod.tgz.html (remove _ )
2. Untgz it somwere for example to homedir. Apears folder: ~/make.sdk
3. Make sure Apple SDK installed to default foilded /Developer
4. Make sure original 1.1.4 filesystem is here: /usr/local/share/iphone-filesystem Otherwise u can change script manually
5. Open terminal on your Mac:
Code:
$ cd ~/make.sdk/
$ ls
Apple Mach-O Linker.xcspec include
GCC 4.0.xcspec keys.sh
Info.plist lib
ProjTempl sdk.sh
SDKSettings.plist sshd_config
Lets start:
$ ./sdk.sh
(#) 1.1.4 platform SDK creation script for XCode 3.0 -- by Darkmen
Copying Aspen1.2...
Configuring XCode GCC plugin...
Configuring SDK prefs...
Removing old templates...
Copying new templates...
Making SDK filesystem:
-Erasing 1.2 System
-Erasing 1.2 lib
Make sure original 1.1.4 filesystem is here: /usr/local/share/iphone-filesystem/
-Copying 1.1.4 iPhone fileystem...
-Copying dev team 1.1.4 headers...
-Copying dev team libs...
Done!
You will need paswordless SSH login to your iPhone to be able to use Run On Device script
You can do it now:
$ export IPHONE_IP=192.168.1.6 (please replace with your iPhone's IP address)
$ ./keys.sh
(#) Passwordless SSH login script -- dy Darkmen
WARNING: Dont forget to change iPhone's IP. Default is 192.168.1.6!
Generating RSA keys for SSH paswordless login on iPhone. Please leave default filenames and empty passphrase!
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/darkmen/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/darkmen/.ssh/id_rsa.
Your public key has been saved in /Users/darkmen/.ssh/id_rsa.pub.
The key fingerprint is:
xx x x x x x x x x x x x x x x x darkmen@darkmac.local
Copying public key to iPhone. First login can take 30 seconds. Password: alpine
root@192.168.1.6's password:
id_rsa.pub 100% 403 0.4KB/s 00:00
Copying SSHD config to iPhone. Password: alpine
sshd_config 100% 3248 3.2KB/s 00:00
Restarting SSHD on iPone...
Connection to 192.168.1.6 closed by remote host.
Done!
We DONE! |
|
| |
Category : IPhone
| Posted By : Eric Shan | Comments[0] | Trackbacks [0] |
|
|
|
22 May 2008 02:12:30 pm |
Cross compile for 2.0 and 1.14 possibility |
|
|
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/System/Library/Frameworks
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/usr/lib
crosscompilation without xcode
http://www.hackint0sh.org/forum/showthread.php?t=33867
Replace lib with 1.14 versions and link
export CFLAGS="-I/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/gcc/arm-apple-darwin9/4.0.1/include/ -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/usr/include -I/Developer/Platforms/iPhoneOS.platform/Developer/usr/include/ -I/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/usr/include"
export CPP="/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp-4.0"
export CPPFLAGS=$CFLAGS
export LDFLAGS="-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/usr/lib/"
export PATH="$PATH:/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/" |
|
| |
Category : IPhone
| Posted By : Eric Shan | Comments[0] | Trackbacks [0] |
|
|
|
15 May 2008 09:27:58 am |
error LNK2001: unresolved external symbol "int __cdecl getop |
|
|
I'm in compileing iphuc under VC6, the getopt got error of
error LNK2001: unresolved external symbol "int __cdecl getopt(int,char * *,char *)" (?getopt@@YAHHPAPADPAD@Z)
This is mean the getopt need to be compile as C function, so in the getopt.h declaie the function as
extern "C" {
int _cdecl getopt(int argc, char **argv, char *opstring);
}
Then the problem was solved. |
|
| |
Category : IPhone
| Posted By : Eric Shan | Comments[0] | Trackbacks [0] |
|
|
|
25 Dec 2007 01:04:05 pm |
Windows下IPhone Toolchain,及Hello.app的完成 |
|
|
根据http://iphone.fiveforty.net/wiki/index.php/Toolchain_installation_-_Windows,看似简单其实花了整个星期才完成.
1.安装cygwin, http://www.cygwin.com 没有什么困难,选项都选到即可.
2.IPhone文件,下载dmg,再用http://iphone.fiveforty.net/wiki/index.php/Talk:Decrypt_Firmware下载解密工具,解完密用TransMac把整个文件系统解出来. TransMac在XP下运行的很好.
3.下载XCode,可以到Emule去下.
4.在Cygwin下svn, svn co http://llvm.org/svn/llvm-project/llvm/trunk 和 svn checkout http://iphone-dev.googlecode.com/svn/trunk/ iphone-dev ,这两个可花了很长时间,遇到多次错误说:
REPORT request failed on '/svn/!svn/vcc/default'
REPORT of '/svn/!svn/vcc/default': 200 OK (http://iphone-dev.googlecode.com)
只要再次运行svn checkout http://iphone-dev.googlecode.com/svn/trunk/ iphone-dev即可在中断后继续
6.7.8.9遇到过的问题很多,每次google后总能找到solution,遇到过的有:
http://code.google.com/p/iphone-dev/issues/detail?id=98
http://code.google.com/p/iphone-dev/issues/detail?id=99
http://code.google.com/p/iphone-dev/issues/detail?id=101
对于symbol link,要用实际的dylib替换才能使链接成功,例如libc.dylib,照教程的说法只要$ ln -s libSystem.B.dylib libc.dylib 即可,实际不行,必须用libSystem.B.dylib完整替换掉libc.dylib,而不是建个link即可.
IPhone ToolChain的完成以最终生成/usr/local/bin/arm-apple-darwin-gcc.exe为完成.
接着build Hello.app,源代码http://iphone.fiveforty.net/wiki/index.php/UIKit_Hello_World
在/home下建个目录Hello,建源代码文件.对于makefile,仔细研究一下makefile的语法,参考一下http://book.csdn.net/bookfiles/132/ 如果直接从网站paste到txt的话注意一下用TAB替换那些开始的空格,TAB在makefile里代表命令行的开始.
最终生成hello.o, helloapplication.o, link成Hello.
把info.plist和Hello放入新建的Hellp.app目录, winscp上传至IPhone的/Application,改Hello成755权限,马上可以看到有一个没有背景图标的Hello.重起Iphone,lauch Hello可以看到自己的成果了.
所有源代码,object file and makefile及最后link出的Hello application都打包在http://blog.tntsoft.com/download/Hello.zip
|
|
| |
Category : IPhone
| Posted By : Eric Shan | Comments[0] | Trackbacks [0] |
|
|
|
20 Dec 2007 02:05:47 pm |
一篇关于在unix linux下用点和反斜杠(./)执行命令的解释 |
|
|
http://www.linfo.org/dot_slash.html
About the Use of Dot-Slash in Commands
The combination of a dot followed directly by a forward slash (./) is often used to precede commands in Linux and other Unix-like operating systems. Although this requirement can seem confusing and even tedious to new users, it exists for good reason and can be useful to understand.
Commands in Unix-like operating systems are either built-ins or executables. The former (e.g., alias, cd, echo, kill, ls and pwd) are part of the shell that is currently running, and thus the shell can always locate them. In contrast, the shell needs help in finding the latter, which can be divided into compiled programs and shell scripts. A compiled program is a program whose source code (i.e., its original, human-readable form) has been converted through the use of a compiler into an executable file (i.e., a ready-to-run form).
A shell is a program that provides the traditional, text-only user interface for Unix-like operating systems. Its primary function is to read commands that are typed in at the command line (i.e., in a text-only mode) and then execute (i.e., run) them. A shell script is a short program that is written in a shell programming language and interpreted (i.e., converted into runnable form) by a shell process.
When some text is typed into a shell and then the ENTER key is pressed, the shell assumes that it is a command. The shell immediately checks to see if the first string (i.e., sequence of characters) in that text is a built-in command or the absolute path (i.e., location relative to the root directory) to an executable.
If it is neither of these, the shell will search the directories listed in that users' PATH environmental variable for a file with that name. PATH (all upper case letters) tells the shell which directories to search for commands in response to commands issued by the user.
If the command is found, it will be executed, assuming that there are no other problems. If it is not found, an error message, such as command not found, will be returned.
Most users work most of the time in their home directory and subdirectories thereof because of convenience and for safety reasons. However, by default such directories are not included in the user's PATH variable. Thus when the user creates a script or compiles a program in one of those directories and attempts to run it by merely typing in its name, an error message will be returned.
However, this problem can be easily overcome by typing a dot and slash in front of the command name. This is merely an abbreviated way to inform the shell that the absolute path of that file is the current directory (i.e., the directory in which the user is currently working). In Unix-like operating systems, a single dot is used to represent the current directory in a path (i.e., the location of a file or directory in the filesystem), including those used in commands. Likewise, forward slashes are used to separate directories and files in paths.
Files in the current directory can be accessed for reading and writing by merely entering the command name (e.g., cat or vi) followed by the name of the file. That is, no absolute path is necessary. However, when execution is desired, either an absolute path (or its dot slash equivalent) or the inclusion of the directory containing the command's executable file in the PATH variable is necessary. This is a built-in safety mechanism.
A user could eliminate the need to precede commands by a dot slash by appending a single dot to the PATH variable, because this would tell the shell to also search the current directory. However, this is generally not advisable on safety and security grounds. For example, were the user to inadvertently create a shell script with the same name as a standard command, the shell could execute the former instead of the latter, thereby causing the system to malfunction, or worse.1
A better alternative if one wants to eliminate the need to precede commands by a dot slash is to create a special directory for the executable files of such commands, and then add this directory to the PATH variable. For example, a user named bob could create a directory named bin in his home directory (i.e., /home/bob/bin/) for this purpose.
Another approach for making it easy to run a program that is installed in a non-standard directory is to create a symbolic link to it (using the ln command with its -s option), and then put the link in a directory that is already in the PATH variable. This can be a safer alternative to adding more directories to PATH.
The dot slash should not be confused with Slashdot, which is the name of a popular web site about computer technology.
________
1An extreme example would be the situation in which an ordinary user created a shell script such as rm -r /, which would delete all files and directories in the system for which the user had writing permission, and named this script ls. Were the system administrator to navigate to the directory in which this script was located and attempt to run the standard ls command in order to view the contents of that directory, the shell would instead run the script with the same name and thereby remove the contents of all currently mounted partitions on the computer! |
|
| |
Category : IPhone
| Posted By : Eric Shan | Comments[0] | Trackbacks [0] |
|
|
|
16 Dec 2007 12:44:18 pm |
Console, tty and ps |
|
|
The difference between console and tty in Unix could be dscribed at http://uwsg.iu.edu/UAU/navigate/tty.html, that is console is the monitor and the keyboard connect to the host with a device of normally /dev/console, while tty is the terminal, ssh or telnet client which map to /dev/ttyp0 , ttyp1, ttyp2. tty means Ternimal Type.
To know how many active tty are active, use ps -a. To send a message to other tty like ttyp3, you can
$ echo "you message" > ttyp3
Other command like write, talk, mesg, wall are using in other unix system.
ps -vx and ps -ux can display all the process currently running and it's status. To kill any process just kill [PID], so I guess it can kill tty user and kick them out from the system.
console和tty的区别可以参考http://uwsg.iu.edu/UAU/navigate/tty.html, console就是接在主机上的键盘与显示器对应于/dec/console,而tty可以是terminal,ssh或telnet的客户端,他们对应/dev/ttyp0,ttyp1,ttyp2等, tty代表Terminal Type.
想要知道当前有多少tty正在接入,用ps -a指令, 向另一个tty发消息可以
$ echo "you message" > ttyp3
其他指令有write, talk, mesg, wall .
ps -vx 和 ps -ux 可以显示当前所有process,杀进程就kill [进程号],所以要踢tty用户,可以考虑kill. |
|
| |
Category : IPhone
| Posted By : Eric Shan | Comments[0] | Trackbacks [0] |
|
|
|
16 Dec 2007 08:56:40 am |
Iphone, Unix Shell prompt changes. 修改Iphone的unix提示符 |
|
|
After install Unix shell on my Iphone of DropBear and BinKIt, I can now log into unix shell with MobileTerminal and Putty.
I need the prompt to show the current working path, I google and found bash should be able to define it under file of:
/etc/profile - generic system-wide profile
.bash_profile - personal profile that is processed every time you login
.bashrc - setup file processed every time you open a non-login shell
In the file I will to add a setence of
export PS1="w> "
So this will make my prompt shows currenty path and a '>', you can type command 'export' to see your current settings, command 'set' can see the current environment parameters.
In finally neither .bash_profile nor .bashrc can take effect and only create a new file of /etc/profile with a single sentence of export PS1="w> " make the job done.
在iphone下装完unix shell,DropBear和BinKIt, 我要提示符自动显示当前目录,查了一下bash可以用三种文件完成,但是最后只有/etc/profile中加入export PS1="w> "起作用 |
|
| |
Category : IPhone
| Posted By : Eric Shan | Comments[0] | Trackbacks [0] |
|
|
|
1 |
|