Hi All
In a script, I want a user to enter 4 characters, these can be a mix of letters (uppercase and lowercase) and numbers.
In this example $var represents what the user has entered.
eg $var can be A9xZ, 3DDL, bbHp .........etc
I need to check that the user has only entered characters... (2 Replies)
Hi,
I have trouble with quotations of the M4 preprocessor.
I want to write a basic makro that removes all spaces and newlines at the end and at the beginning of a string.
I tried this:
define(`TRIM_END', `patsubst(`$1', `\(\\n\| \)*$', `')')
define(`TRIM', `patsubst(`TRIM_END(`$1')',... (0 Replies)
Can someone explain the following? I can use find on *.pm without quotes, but find on *.pl makes on error, I need quotes for the second version. What's up with that?
$find -name *.pm
./tieProxyStatus/Status.pm
$find -name *.pl
find: paths must precede expression
Usage: find
$find... (2 Replies)
hi guys, i have a question related to quoting but i am not sure how to formulate it...
lets say we want to simulate the following shell actions
cd ~/project-dir
ctags /home/work/folder1/*.sh /home/work/folder2/*.sh /home/work/folder3/*.sh
so i make the following script
buidtags.sh
... (2 Replies)
I can do this on the command line:
sqsh -S 192.168.x.x -o tmp -U user -P fakepass -D horizon -C "\
select second_id
from borrower
where btype like '%wsd%'
"
I can also just leave the SQL at the end intact on one line ....
... However, when I throw this in a script like:
$SQSH -o... (4 Replies)
Hi all,
i have a file that looks like:
one:two:three:four:five
six:seven:eight:nine:ten
and i'd like to quote the fourth column, getting:
one:two:three:"four":five
six:seven:eight:"nine":ten
i was thinking something like:
awk 'BEGIN{FS=":"}{print $1 FS $2 FS $3 FS \"$4\" FS $5}'... (5 Replies)
I am writing a bash script to automate the installation of web environment on a base install of Fedora. And I'm at the limit of my last nerve and my bash skills. My brain is screaming at me: "Give up and use perl", but I am trying to stick to bash since the script will modify the perl environment... (6 Replies)
Hi,
I have got a file comp_data containing the below data :
38232836|9302392|49
39203827|8203203,3933203|52
72832788|567,3245,2434324|100
This file can have many rows like shown above. I want the values separated by "," in second column(taking "|" as delimiter) to be in quotes. These... (2 Replies)
I am trying to write a BASH script that will prompt a user to enter a number of days, then calculate the date.
My problem is the date command uses single or double quotes. For Example..
date -d "7 days"
Here is an example of some same code I am trying to work through.
echo "when do you... (4 Replies)
Discussion started by: javajockey
4 Replies
LEARN ABOUT MOJAVE
osascript
OSASCRIPT(1) BSD General Commands Manual OSASCRIPT(1)NAME
osascript -- execute OSA scripts (AppleScript, JavaScript, etc.)
SYNOPSIS
osascript [-l language] [-i] [-s flags] [-e statement | programfile] [argument ...]
DESCRIPTION
osascript executes the given OSA script, which may be plain text or a compiled script (.scpt) created by Script Editor or osacompile(1). By
default, osascript treats plain text as AppleScript, but you can change this using the -l option. To get a list of the OSA languages
installed on your system, use osalang(1).
osascript will look for the script in one of the following three places:
1. Specified line by line using -e switches on the command line.
2. Contained in the file specified by the first filename on the command line. This file may be plain text or a compiled script.
3. Passed in using standard input. This works only if there are no filename arguments; to pass arguments to a STDIN-read script, you must
explicitly specify ``-'' for the script name.
Any arguments following the script will be passed as a list of strings to the direct parameter of the ``run'' handler. For example, in
AppleScript:
a.scpt:
on run argv
return "hello, " & item 1 of argv & "."
end run
% osascript a.scpt world
hello, world.
The options are as follows:
-e statement
Enter one line of a script. If -e is given, osascript will not look for a filename in the argument list. Multiple -e options may be
given to build up a multi-line script. Because most scripts use characters that are special to many shell programs (for example,
AppleScript uses single and double quote marks, ``('', ``)'', and ``*''), the statement will have to be correctly quoted and escaped to
get it past the shell intact.
-i Interactive mode: osascript will prompt for one line at a time, and print the result, if applicable, after each line. Any script sup-
plied as a command argument using -e or programfile will be loaded, but not executed, before starting the interactive prompt.
-l language
Override the language for any plain text files. Normally, plain text files are compiled as AppleScript.
-s flags
Modify the output style. The flags argument is a string consisting of any of the modifier characters e, h, o, and s. Multiple modi-
fiers can be concatenated in the same string, and multiple -s options can be specified. The modifiers come in exclusive pairs; if con-
flicting modifiers are specified, the last one takes precedence. The meanings of the modifier characters are as follows:
h Print values in human-readable form (default).
s Print values in recompilable source form.
osascript normally prints its results in human-readable form: strings do not have quotes around them, characters are not escaped,
braces for lists and records are omitted, etc. This is generally more useful, but can introduce ambiguities. For example, the
lists '{"foo", "bar"}' and '{{"foo", {"bar"}}}' would both be displayed as 'foo, bar'. To see the results in an unambiguous form
that could be recompiled into the same value, use the s modifier.
e Print script errors to stderr (default).
o Print script errors to stdout.
osascript normally prints script errors to stderr, so downstream clients only see valid results. When running automated tests, how-
ever, using the o modifier lets you distinguish script errors, which you care about matching, from other diagnostic output, which
you don't.
SEE ALSO osacompile(1), osalang(1), AppleScript Language Guide
HISTORY
osascript in Mac OS X 10.0 would translate '
' characters in the output to '
' and provided c and r modifiers for the -s option to change
this. osascript now always leaves the output alone; pipe through tr(1) if necessary.
Prior to Mac OS X 10.4, osascript did not allow passing arguments to the script.
Mac OS X April 24, 2014 Mac OS X