Basically I am a SAP programmer. I don't know much about UNIX. But I got a situation, need to use UNIX script /command in my programming.
I searched the forum and found the below code.
I would like to pass the below UNIX script in my programming code. But my programming will not allow line by line.
Can I able to pass below script in one single line.
Could anybody help me.
I need to create a script that reads a text file from STDIN and prints out the file to STDOUT with line numbers at the beginning of each line.
Thanks. (5 Replies)
Hi ,
I have a piece of code ...wherein I need to assign the following ...
1) A command line argument to a variable
e.g origCount=ARGV
2) A unix command to a variable
e.g result=`wc -l testFile.txt`
in my awk shell script
When I do this :
print "origCount" origCount --> I get the... (0 Replies)
Hi,
Well my title isn't very clear I think. So to understand my goal:
I have a script "test1"
#!/bin/bash
xvkbd -text blabla
with xbindkeys, I bind F5 key in order it runs my test1 script
So when I press F5, test1 runs.
I'm under Emacs/Vi and I press F5 in order to have "blabla" be... (0 Replies)
so in unix this command works works and shows me a list of directories
find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt
but when i try running a perl script to run this command
my $query = 'find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt';... (2 Replies)
I'm trying to write a bash script called YN that looks like the following
YN "Specify a question" "doThis" "doThat"
where "doThis" will be executed if the answer is "y", otherwise "doThat".
For example
YN "Do you want to list the file dog?" "ls -al dog" ""
Here's my attempt... (3 Replies)
Hi all,
I am having problem in understanding the following line of code ..
/home/rmsbatch/autoscript/autorms.ksh dc_load_main.ksh -q belk_dc_load_tran_data.seq
What's being done here ? what does "-q" means ? What does ".seq" file means in unix "belk_dc_load_tran_data.seq"
Please... (3 Replies)
Hi All,
Am needing advise on how to convert xls file to xlsx format on Solaris unix command line or scripting. I tried searching online but it looks like I need to either use Perl packages of Excel or Python packages or some other 3rd party tool. Problem is to install any of these will require... (2 Replies)
i have a text file as belows, it includes 2 columns, 1st is the column name, 2nd is the file_name
data_file.txt
column_name file_name
col1 file1
col2 file2
col3 file1
col4 file1
col5 file2
now, i would like to... (4 Replies)
Discussion started by: tester111
4 Replies
LEARN ABOUT PHP
apc_cas
APC_CAS(3) 1 APC_CAS(3)apc_cas - Updates an old value with a new valueSYNOPSIS
bool apc_cas (string $key, int $old, int $new)
DESCRIPTION apc_cas(3) updates an already existing integer value if the $old parameter matches the currently stored value with the value of the $new
parameter.
PARAMETERS
o $key
- The key of the value being updated.
o $old
- The old value (the value currently stored).
o $new
- The new value to update to.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
apc_cas(3) example
<?php
apc_store('foobar', 2);
echo '$foobar = 2', PHP_EOL;
echo '$foobar == 1 ? 2 : 1 = ', (apc_cas('foobar', 1, 2) ? 'ok' : 'fail'), PHP_EOL;
echo '$foobar == 2 ? 1 : 2 = ', (apc_cas('foobar', 2, 1) ? 'ok' : 'fail'), PHP_EOL;
echo '$foobar = ', apc_fetch('foobar'), PHP_EOL;
echo '$f__bar == 1 ? 2 : 1 = ', (apc_cas('f__bar', 1, 2) ? 'ok' : 'fail'), PHP_EOL;
apc_store('perfection', 'xyz');
echo '$perfection == 2 ? 1 : 2 = ', (apc_cas('perfection', 2, 1) ? 'ok' : 'epic fail'), PHP_EOL;
echo '$foobar = ', apc_fetch('foobar'), PHP_EOL;
?>
The above example will output something similar to:
$foobar = 2
$foobar == 1 ? 2 : 1 = fail
$foobar == 2 ? 1 : 2 = ok
$foobar = 1
$f__bar == 1 ? 2 : 1 = fail
$perfection == 2 ? 1 : 2 = epic fail
$foobar = 1
SEE ALSO apc_dec(3), apc_store(3).
PHP Documentation Group APC_CAS(3)