Command line file read
How do i read the command line statements using the getop function in java?
Let's say i have 5 arguments which i enter on command line.2 of which is to read from a file and write to a file.
for this case, how do i initialise and use the getop?
rgds
Hi,
There is a GetOpt in com.sun.org.apache.xalan.internal.xsltc.cmdline.getopt.GetOpt. The source code explains how it works. The compiler does warn that the functionality may be removed in the future.
Good Luck
Similar Messages
-
ISM-SRE-300 seems to be a loop at boot with Verifying ... Invalid signature in command line file
Any ideas?
Log
Install of ftp://*****:*****@10.100.64.21/cue-vm-k9.SPA.sme.8.6.7.pkg in progress
Install status : Waiting for RBIP registration
No localstore
2911#
[Resuming connection 1 to 10.102.66.254 ... ]
Initializing memory. Please wait...
Memory initialization OK. Continue...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
SRE step 2 - SM requests key file info...
SRE step 3 - SM stores registration info...
SRE configuration keeps the same. No flash update needed!
SRE step 4 - SM downloads key-file...
Writing keyfile to flash Size 891
writing complete.
Updating flash with bootloader configuration.
Please wait .................. done.
SRE step 5 - SM requests installer info...
SRE step 6 - SM stores installer info...
Updating flash with bootloader configuration.
Please wait .................. done.
SRE step 7 - SM now downloads installer
done.
SRE step 8 - SM requests tcl header file info...
SRE step 9 - SM now downloads the tcl header file
TCL header file downloaded completely size: 691
SRE step 10 - SM requests tcl file info...
SRE step 11 - SM now downloads the tcl file
TCL file downloaded completely size: 38933
SRE step 12 - SM now boots Installer
Verifying ... done.
Starting Kernel.
Platform: ism
INIT: version 2.86 booting
mounting proc fs ...
mounting sys fs ...
mounting /dev/shm tmpfs ...
kernel.sem = 1900 4000 32 100
vm.overcommit_memory = 1
vm.min_free_kbytes = 8192
Welcome to Cisco Service Engine
Setting the system time from hardware clock
********** rc.aesop ****************
Populating resource values from /etc/ism_rsrc_file
Populating resource values from /etc/default_rsrc_file
Populating resource values from /etc/products/cue/default_rsrc_file
Populating resource values from /etc/products/cue/ism_rsrc_file
==> Management interface is eth0
==> Management interface is eth0
IOS IP Address Registration complete.
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
10.102.66.0 * 255.255.255.0 U 0 0 0 eth0
default 142.102.66.254 0.0.0.0 UG 0 0 0 eth0
Size of buff is: 65536
65536 bytes written
Valid License file not found: Using default values
INIT: Entering runlevel: 2
********** rc.post_install ****************
Changing owners and file permissions.
INIT: Switching to runlevel: 4
INIT: Sending processes the TERM signal
STARTED: dwnldr_startup.sh
sre_type= 1
Welcome to Cisco Systems Service Engine Helper Software
Downloading ftp cue-vm-k9.SPA.sme.8.6.7.pkg
Bytes downloaded : 727736
Validating package signature ... done
- Parsing package manifest files... complete.
No installed manifests found.
- Checking Package dependencies... complete.
Downloading ftp cue-vm-langpack.sme.8.6.7.pkg
Error: Download error
Can not download cue-vm-langpack.sme.8.6.7.pkg
error code 550 : error type 'Can not ▒
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...ISM-SRE-300 seems to be a loop at boot with Verifying ... Invalid signature in command line file
Any ideas?
Log
Install of ftp://*****:*****@10.100.64.21/cue-vm-k9.SPA.sme.8.6.7.pkg in progress
Install status : Waiting for RBIP registration
No localstore
2911#
[Resuming connection 1 to 10.102.66.254 ... ]
Initializing memory. Please wait...
Memory initialization OK. Continue...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
SRE step 2 - SM requests key file info...
SRE step 3 - SM stores registration info...
SRE configuration keeps the same. No flash update needed!
SRE step 4 - SM downloads key-file...
Writing keyfile to flash Size 891
writing complete.
Updating flash with bootloader configuration.
Please wait .................. done.
SRE step 5 - SM requests installer info...
SRE step 6 - SM stores installer info...
Updating flash with bootloader configuration.
Please wait .................. done.
SRE step 7 - SM now downloads installer
done.
SRE step 8 - SM requests tcl header file info...
SRE step 9 - SM now downloads the tcl header file
TCL header file downloaded completely size: 691
SRE step 10 - SM requests tcl file info...
SRE step 11 - SM now downloads the tcl file
TCL file downloaded completely size: 38933
SRE step 12 - SM now boots Installer
Verifying ... done.
Starting Kernel.
Platform: ism
INIT: version 2.86 booting
mounting proc fs ...
mounting sys fs ...
mounting /dev/shm tmpfs ...
kernel.sem = 1900 4000 32 100
vm.overcommit_memory = 1
vm.min_free_kbytes = 8192
Welcome to Cisco Service Engine
Setting the system time from hardware clock
********** rc.aesop ****************
Populating resource values from /etc/ism_rsrc_file
Populating resource values from /etc/default_rsrc_file
Populating resource values from /etc/products/cue/default_rsrc_file
Populating resource values from /etc/products/cue/ism_rsrc_file
==> Management interface is eth0
==> Management interface is eth0
IOS IP Address Registration complete.
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
10.102.66.0 * 255.255.255.0 U 0 0 0 eth0
default 142.102.66.254 0.0.0.0 UG 0 0 0 eth0
Size of buff is: 65536
65536 bytes written
Valid License file not found: Using default values
INIT: Entering runlevel: 2
********** rc.post_install ****************
Changing owners and file permissions.
INIT: Switching to runlevel: 4
INIT: Sending processes the TERM signal
STARTED: dwnldr_startup.sh
sre_type= 1
Welcome to Cisco Systems Service Engine Helper Software
Downloading ftp cue-vm-k9.SPA.sme.8.6.7.pkg
Bytes downloaded : 727736
Validating package signature ... done
- Parsing package manifest files... complete.
No installed manifests found.
- Checking Package dependencies... complete.
Downloading ftp cue-vm-langpack.sme.8.6.7.pkg
Error: Download error
Can not download cue-vm-langpack.sme.8.6.7.pkg
error code 550 : error type 'Can not ▒
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting... -
Creating a command line program reading AEP/AEPX files?
I'm new with After Effects SDK, and I wanted to know if it's possible to use SDK to implement a command line program that gets information such as duration and frame rate in AEP/AEPX files.
aerender, a command line render program provided by After Effects, prints out these information before rendering. But it doesn't seem to be able to print out the information without doing rendering.
I saw a related thread here: http://forums.adobe.com/thread/844341
But what I want is simpler. I don't need to alter the AEP/AEPX files. I just want to obtain the information quickly from an AEP/AEPX file. Is it possible to write such a tool using SDK?
Thanks!hi eliang.cs!
yes, i'm the same guy who answered on the other thread.
everything the API does, it does through AE as a plug-in.
so if you have AE running (even just the renderer), your project loaded and your plug-in present, you can access all the data you described with no problem, and export it out in whatever way you want. (a plug-in is actually a DLL, so you can do anything you want, even on an OS level)
you can access the data on all elements of the project including comps, layers, footage, render queue, ect...
having said that, you can do all of this using a script instead of a plug-in.
scripts are much easier to build.
perhaps there's even a script out there that does what you're looking for, or something very close that could easily be adjusted. -
I want to use reader with command lines (to print a document for exemple) without open reader with the mouse.
Is someone knows the solution ?
ThanksThere's no pdf printer provided with reader, so there's no printing command associated with reader specifically. you need Adobe Acrobat for that purpose.
Instead, you can use commands to invoke your system printer and pass a pdf file to it. -
How to execute some code in command line, and read its output?
I'v found here http://www.sap-advisor.com/abap-coding/how-to-execute-operating-system-commands-from-within-sap/ that I can execute commands from the windows command line for example inside SAP.
But I want to take it one step further and read its output. is it possible?Hi RagnaRock,
one possible approach can be outputting the results of the command into a text file (i.e. "command >result.txt"), and then read this file from SAP/ABAP.
I hope this helps. Kind regards,
Alvaro -
Slow processing time, via Command line, with Reader
I'm using Reader 9, via command line, to process PDFs in a 3rd party application and it's taking much longer to process files this way than with Acroplot or Ghostscript. Is there a way to improve this processing time?
thanksLadies and gentlemen.....I have solved my problemo!
The reason why the rest of the reports were getting the 'could not open file.' error was due to the fact that each discoverer instance launched was
trying to access the same standard log file simultaneously.
I modified each cmd file to write logging info to individual files: eg
/logfile "H:\Projects\DRP Import Modelling\Automation\input2_log.txt"
Now that's there's no contention with logging, the reports are firing off beautifully in parallel :)
I am definitely having a beer this evening!
Thanks for everyone's input...kept me on the righteous path :) -
Deployment failing when running .bat script or command line file package
HI Guys,
I am trying to run a .bat file on a client using a program. My data source point to the script's folder.
I keeps failing with error 1.
I have trying making run in 64-bit using this without luck: http://madluka.wordpress.com/2012/09/24/configmgr-2012-64bit-file-system-redirection-bites-again/
Here is the content of my .bat file:
@ECHO OFF
IF NOT "%PROCESSOR_ARCHITEW6432%"=="AMD64" GOTO native
ECHO "Re-launching Script in Native Command Processor..."
%SystemRoot%\Sysnative\cmd.exe /c %0 %*
EXIT
:native
ECHO "Running Script in Native Command Processor..."
c:\
cd c:\windows\System32
start cmd.exe /c shutdown -l
stop
I will get the same error when running a simply command line as well. Instead of a .bat file.
any ideas?Maybe this will help you:
http://blog.coretech.dk/kea/configuration-manager-shutdown-utility
This instead of using "shutdown.exe -l" command. This tool can be used for logoff also. Hope it helps!
My blogs: Henk's blog and
Virtuall | Follow Me on:
Twitter | View My Profile on:
LinkedIn -
Return Code after Command Line (File Adapter)
Hello all,
i execute in the File Receiver Channel a Shell Script.
Now i need a solution, when an error happens. The script returns an error code and i want that the Adapter Monitor is showing this information/error.
How can i enable this?
Or is there an other possibility to monitor this??
many thanks for your help
ilkaHi IIka,
I have not tried this but I think
The return code of the script cannot be shown in monitor, because the call ends (does not expect a response) once the file adapter is called.
May be you can capture the errors in a seperate file and
use that as a log.
I am not sure if there is anyother way
also check this blog /people/michal.krawczyk2/blog/2005/08/17/xi-operation-system-command--error-catching
Regards
Vishnu -
Run javascript (not in a jsx file) from the command line extendscript
Hi all,
I was wondering if anyone knew how to run javascript from the command line in Extendscript (meaning Extendscript would be the target application). I know about the -run command line flag in which allows you to run a .jsx script from the command line but what I'm looking for similar syntax to run a script directly without needing to put it in a file. For example I have tried (obviously unsuccessfully):
C:\Program Files (x86)\Adobe\Adobe ExtendScript Toolkit CC\ExtendScript Toolkit.exe -run "alert('Hello World');"
Thanks!You might be looking for something like this: javascript - Is it possible to execute JSX scripts from outside ExtendScript? - Stack Overflow
Although that one is about executing JSX files, the solutions given (Applescript as well as COM/VBScript) can be adapted to simply run a javascript code snippet rather than JSX file because the solutions simply call the Adobe app's Applescript/COM API to "execute javascript" (actually execute ExtendScript technically), and in the solution, they using includes to pull in the JSX file. You'd simply replace the include with actual javascript code snippet inserted in.
Though this would then require you to run a VBScript, Applescript, or other script (that calls the COM/Applescript API) rather than the ESTK command line option. -
Hello -
I have done an IDOC->XI-File scenario, everything looks good except for one line that needs to be added.
Without using XSLT/JAVA mapping (not that complex scenario), is it possible to modify the file that has been received to add an extra line.
For e.g after i have received the file, looks like this:
<xml>
<a>
<b>test</b>
</a>
Can i write a command line program for the file receiver adapter in the communication channel to modify the receiver file to add an extra line.
For e.g.
<xml>
This is a test
<a>
<b>test</b>
</b>
This is an example but in the real case its a huge file and believe me its a straight mapping from IDOC to the file but only thing needed is an extra line of text that needs to be added for which i do not want to use the XSLT or JAVA mapping programs.
Is it possible through the command line to read the Received file and modify the file by writing that extra line.
Any clues would really help.
Thanks,
TirumalYes, if you are using file content conversion all you need to do is add this parameters.
The URL tells yuo how u should use it.
http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
Regards
Vijaya
Message was edited by: vijaya kumari -
Command line to sort semi-colon delimited string
I'm sure there's a simple solution eluding me... I have an app which stores sets as a string like:
"bee;ant;cow;ant;Aardvark;dog"
which I want to sort to a string like:
"Ardvark;ant;bee;cow;dog"
...where letter sort** is case insensitive and number strings sort on numberical value (i.e. 1,2,10 not 1,10,2). FWIW, the string length is likely to be short and not large numbers of delimited terms - in case that matters.
** I can duck issue of sorting & accented characters if that's a significant complication at this point.
The app in question can't do the sort but can call a Unix command line and read its stdout. I want a single command line not an external script for portability/support reasons, though it doesn't matter if the CL is long. So, please don't suggest I use a script even if it's your own preferred method!
I thought of using 'sort' but that's for lines in a file vs a single input line. I guess I use awk, or can a pass perl as a CL (as opposed to calling a script)? Either way, my poring over the references I have hasn't showed me a solution and I don't know perl. Here's hoping someone can point me in the right direction.
TIA
MarkHere's one way to accomplish what you're asking:set stuff2Sort to "bee;ant;cow;ant;Aardvark;dog;1;10;2"
set sortedStuff to sortStuff(stuff2Sort)
on sortStuff(x)
set tmpSort to paragraphs of (do shell script "echo " & quoted form of x & " | awk 'gsub(\"",\"\\n\") {print}' | sort -g")
set oldDelims to text item delimiters
set text item delimiters to ";"
set theSorted to tmpSort as string
set text item delimiters to oldDelims
return theSorted
end sortStuffI don't know if the ";" and "\" are appearing correctly or not. When I preview this post it shows up as a smiley face even though I have it in a code block!
Hope this helps...
Message was edited by: Chachi
Sorry, thought I was in the Applescript forum! DOH!!! -
Filenames as Command Line Arguments: How?
i need to create a program that involves taking in a file name as command line argument, reads the file and then displays its contents on the screen. it needs to work with any file with a .txt extension.
The only thing i dont fully understand is how to read the file name as a command line argument e.g.
"java FileReaderApp myfile.txt
----contents of file--------
Thanks in advance
Carl
P.S. I have lready read the various helps, utils etc for java and still dont really understandOkay, first, it will help if you don't think of "filenames as command line args." The two concepts are totally independent.
Command line args are Strings. What you do with those Strings is up to you. Processing the command line args is the same, regardless of whether they represent file names or the turnons of the last 50 playmates.
The args array below contains the command line args.
public static void main(String[] args) {
// do stuff
} Files are generally referred to using the java.io.File. It takes a String for the file name. It doesn't matter where the String comes from.
Look at FileReader and BufferedReader to actually read the contents of the file.
http://java.sun.com/j2se/1.4.2/docs/api/java/io/FileReader.html
http://java.sun.com/j2se/1.4.2/docs/api/java/io/BufferedReader.html
For the basic command line arg stuff, one of the following should have some info and examples
http://java.sun.com/docs/books/tutorial/
http://java.sun.com/learning/new2java/index.html
http://javaalmanac.com
http://www.jguru.com
http://www.javaranch.com
Bruce Eckel's Thinking in Java
Joshua Bloch's Effective Java
Bert Bates and Kathy Sierra's Head First Java -
Append 'init=/bin/systemd' to kernel command line
I have just updated my Arch_64bit and have been adviced by Pacman to ":: Append 'init=/bin/systemd' to your kernel command line in your bootloader to replace sysvinit with systemd".
I dual boot Ubuntu and Arch and use the GRUB2 from Ubuntu. I have installed Arch's Grub to its own partition.
However there is no /etc/default/grub in my File System instead there is /boot/grub/menu.lst... mine is a recent Arch install and I wonder how I ended up with Grub1.
In /etc/default/grub I would have edited: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash init=/bin/systemd". I have no idea how to deal with Grub1 /boot/grub/menu.lst.
Pointers will be helpful.
Also, why do I need to append 'init=/bin/systemd' to the kernel command line? Without doing so my Arch is booting and working fine. So far I haven't encountered any issues I can tell with my current Arch, the way it is.
Do I need really need to append the above to my Kernel command line?
Thanksfantab wrote:
I have just updated my Arch_64bit and have been adviced by Pacman to ":: Append 'init=/bin/systemd' to your kernel command line in your bootloader to replace sysvinit with systemd".
I dual boot Ubuntu and Arch and use the GRUB2 from Ubuntu. I have installed Arch's Grub to its own partition.
Thanks Jason, (and thanks for the quote I use as signature)
However, it turns out that I may NOT have installed GRUB during Arch install... 'coz there are no 'stage' files in the /boot/grub there is just menu.lst and also because mine is only a few months old Arch install.
#pacman -SS does not show GRUB as installed. So I did not install it.
So how do I go about it? Do I have Install GRUB now to "append 'init=/bin/systemd' to kernel command line"? -
Is retreiving a db connection from the command line possible?
I have some Java code that is part of a larger monthly data processing application that is run via scripts on AIX. In the middle of the data processing, one of the scripts calls my Java code, which reads in data from one table, does some magic on it, and outputs it to another table, which the calling script then accesses and everything goes on its merry way.
Currently, the user id, password and db url are stored in a property file that the Java app uses to make the database connection. In an effort to increase security, my team is removing all db connection information from property files such as this and creating one common script that will be executed to connect to the databases, hiding the connection info and reducing the number of locations that passwords must be updated every 90 days.
So my question is this: When running a processing script, executing this common connection script creates the db connection and database commands can be issued from the processing script. In a similar vein, is there a way for my Java app to call this common connection script and retrieve the connection object for use inside the Java app?flyingmullet wrote:
I have some Java code that is part of a larger monthly data processing application that is run via scripts on AIX. In the middle of the data processing, one of the scripts calls my Java code, which reads in data from one table, does some magic on it, and outputs it to another table, which the calling script then accesses and everything goes on its merry way.
Currently, the user id, password and db url are stored in a property file that the Java app uses to make the database connection. In an effort to increase security, my team is removing all db connection information from property files such as this and creating one common script that will be executed to connect to the databases, hiding the connection info and reducing the number of locations that passwords must be updated every 90 days.
So my question is this: When running a processing script, executing this common connection script creates the db connection and database commands can be issued from the processing script. In a similar vein, is there a way for my Java app to call this common connection script and retrieve the connection object for use inside the Java app?No
But the script could pass the connection information to the java program as command line arguments. -
Is it possible to script Firefox to do things from the command line?
Specifically, I am attempting to print a web page at a specific url from the command line.
Thanks for the quick reply. I had already seen the page you linked to, but it doesn't have any commands to print a web page. Should I interpret from that absence that there isn't a way to print from Firefox from the command line?
Maybe you are looking for
-
How to Create a Link to a Discoverer Workbook in Apps11i?-[solved]
I tried to create a link to a disco workbook in apps 11i using metalink document 278095.1. It seems to be working ok for discoverer which is installed on the same machine as the apps11i is on(because when I clicked on the link which I have created in
-
HT201317 How do I include all photos in photo stream on Apple TV?
I can only see photo stream photos as of march 19, but I have them from a year ago. How do I get them to photo stream on my Apple TV? They are on my iPad under photo stream
-
How to read the code of html page
Hi, I want to know how to read the code of html page through Java? And if anyone know the link of full implementation of Page Rank Algorithm in Java. Please let me know. I have to do the project on that topic. Regard Vivek
-
Hi Please let me know the steps of Configuration UWL in EP. Also, let me know how Users are assigned / removed to access UWL. Regards
-
I am unable to open nor download any files apart from images and html. pdf.js won't work either.