You're using the filename instead of the content of the file and it's more efficient to call the date command once:
Actualy this command is sufficient to do the job:
That's very interesting, so the list file name is actually fed into the loop (or command) at the very end of the script as opposed to the front. Is there a specific reason for this? Or is it just the way the syntax works? This is all very informative for me, I appreciate it!
Also, I'd like to put in some error handling. Specifically to watch for file names that would not be present. Would I be looking for the program code variable "$?"? I'm seeing from other examples that checking $? for a non-zero value indicates that the command failed.
Hi,
I have tried many times to add the string into the first line of the file or the middle of the file but could not find the solution.
I first tried by
$echo "paki" >> file
This code only append paki string at the end of file "file" but how can i add this "paki" into the first line or... (5 Replies)
i want to add a string in a very top of a file without using VI or SED or AWK
this is what ive done:
(echo '0a'; echo 'LINE OF TEXT'; echo '.'; echo 'wq') | ed -s myfile
to add astrng right in the middle i could have count the lines of the file and just chenge the address.
... (6 Replies)
Hi,
I am new to shell scripting, Can any body suggest me how I can split a string with a delimiter as whitespace into words and store into a array.
I have read a line from file, now I want to split the line into words and store in a array for further use.
eg : the sky is blue
want... (3 Replies)
I am trying to strip out certain characters from a string on both (left & right) sides. For example, line=see@hear|touch, i only want to echo the "hear" part. Well i have tried this approach:
line=see@hear|touch
templine=${line#*@} #removed "see@"
echo ${templine%%\|*} #removed... (4 Replies)
Hi,
I want to write a script that takes a file and a string as params and adds the string to the middle line of the file. Also, I want to output the results back to the original file passed without using temp files.
I am very much new to UNIX so this is all a little like black magic to me at... (15 Replies)
Hello I need help with the following. I have strings like
#if defined(__def1__)
#if defined(__def1__) || defined(__def2__)
#if defined(__def1__) && defined(__def2__) && defined(__def3__).
#if defined(__def1__) || defined(__def2__) || defined(__def3__).
I need to print what is there in... (4 Replies)
my file input is with tab as delimiter, and in every line, there would be a skip of line with an unexcepted newline breaker. I'd like to remove this \n and put the information in the same line.
INPUT
a1 b1b2 c1
c2 d1
a2 b3 c3 d4
OUTPUT
a1 b1b2 c1c2 ... (9 Replies)
Hi Guys,
Hope, you all are doing good out there.
I am writing a shell script and currrint in need of your help.
This is what I need to do;
I have position based plain file. One of the fields is 15 character long. I need to fill that field. The problem is that the value is dynamic, it could... (4 Replies)
Hi Folks!
I hope you can help me figure this out. I need to print a record which contains the contents of a config file. The contents of the config file should be found within the 21st and the 30th position of the fixed width reference file.
Config File:
aaaa
bbbb
cccc
Reference... (3 Replies)
Discussion started by: kokoro
3 Replies
LEARN ABOUT DEBIAN
picolisp
PICOLISP(1) User Commands PICOLISP(1)NAME
pil, picolisp - a fast, lightweight Lisp interpreter
SYNOPSIS
pil [arguments ...] [-] [arguments ...] [+]
picolisp [arguments ...] [-] [arguments ...] [+]
DESCRIPTION
PicoLisp is a Lisp interpreter with a small memory footprint, yet relatively high execution speed. It combines an elegant and powerful lan-
guage with built-in database functionality.
pil is the startup front-end for the interpreter. It takes care of starting the binary base system and loading a useful runtime environ-
ment.
picolisp is just the bare interpreter binary. It is usually called in stand-alone scripts, using the she-bang notation in the first line,
passing the minimal environment in lib.l and loading additional files as needed:
#!/usr/bin/picolisp /usr/lib/picolisp/lib.l
(load "@ext.l" "myfiles/lib.l" "myfiles/foo.l")
(do ... something ...)
(bye)
INVOCATION
PicoLisp has no pre-defined command line flags; applications are free to define their own. Any built-in or user-level Lisp function can be
invoked from the command line by prefixing it with a hyphen. Examples for built-in functions useful in this context are version (print the
version number) or bye (exit the interpreter). Therefore, a minimal call to print the version number and then immediately exit the inter-
preter would be:
$ pil -version -bye
Any other argument (not starting with a hyphen) should be the name of a file to be loaded. If the first character of a path or file name is
an at-mark, it will be substituted with the path to the installation directory.
All arguments are evaluated from left to right, then an interactive read-eval-print loop is entered (with a colon as prompt).
A single hyphen stops the evaluation of the rest of the command line, so that the remaining arguments may be processed under program con-
trol.
If the very last command line argument is a single plus character, debugging mode is switched on at interpreter startup, before evaluating
any of the command line arguments. A minimal interactive session is started with:
$ pil +
Here you can access the reference manual
: (doc)
and the online documentation for most functions,
: (doc 'vi)
or directly inspect their sources:
: (vi 'doc)
The interpreter can be terminated with
: (bye)
or by typing Ctrl-D.
FILES
Runtime files are maintained in the ~/.pil directory:
~/.pil/tmp/<pid>/
Process-local temporary directories
~/.pil/history
The line editor's history file
BUGS
PicoLisp doesn't try to protect you from every possible programming error ("You asked for it, you got it").
AUTHOR
Alexander Burger <abu@software-lab.de>
RESOURCES
Home page: http://home.picolisp.com
Download: http://www.software-lab.de/down.html
PICOLISP(1)