Sponsored Content
Top Forums Programming Passing argument to a program!! Post 302578335 by CarloM on Thursday 1st of December 2011 10:19:02 AM
Old 12-01-2011
argv[1] is a string (array of char) - you need to convert it to an int before assigning it (e.g. with atoi).
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem with Argument Passing

Greetings, I am wrapping the monitoring commands like vmstat, sar, iostat and call via arguments I want ./unix_stats.sh -v vmstat -p <SEC> -d <Duration> to give vmstat values, and similarly iostat etc.,. Also if I give ./unix_stats.sh -v vmstat -i iostat -p <SEC> -d <Duration> should give... (4 Replies)
Discussion started by: A_Rod
4 Replies

2. Shell Programming and Scripting

passing Argument

Hi All, i have script like below.. echo "1) first option" echo "" echo "2) second option" echo "" echo "*) please enter the correct option" read select case $select in 1) echo "first option selected" ;; 2) echo "second option selected" ;; *) echo "please enter the correct... (4 Replies)
Discussion started by: Shahul
4 Replies

3. Shell Programming and Scripting

Help with Passing argument and testing

Hi all First of all thanks for everyone to read by doubt.Am beginner in shell scripting Following are my doubts i have to pass an argument to shellscript how can i do that second i have to test the argument and shows error when nothing is passes third i have to match exact argument... (3 Replies)
Discussion started by: zeebala1981
3 Replies

4. Programming

Passing argument to command in C

Hello all, New to C and I'm trying to write a program which can run a unix command. Would like to have the option of giving the user the ability to enter arguments e.g for "ls" be able to run "ls -l". I would appreciate any help. Thanks #include <stdio.h> #include <unistd.h> #include... (3 Replies)
Discussion started by: effizy
3 Replies

5. Shell Programming and Scripting

passing an option as an argument!

Hi Folks I have got to the point where I can specify the arguments but how to pass an option is still mystery to me. Example: temp.csh a b c d set temp1 = $argv set temp2 = $argv set temp3 = $argv echo $temp1 a echo $temp2 b echo $temp3 c d I WANT: temp.csh a b c d -S 1 set temp1... (2 Replies)
Discussion started by: dixits
2 Replies

6. Shell Programming and Scripting

Passing user argument

Hi all: I'm trying to pass an argument to a command but it's being difficult. #!/bin/bash set -xv if ; then echo "More than 1 argument entered" echo "Please enter a month using 3 character names, ie, Jan, Mar, Apr, Dec" && exit 1 fi if ; then echo "Please enter a month using... (2 Replies)
Discussion started by: raggmopp
2 Replies

7. Shell Programming and Scripting

Help with passing argument

Hi, I have a script that is scheduled with cron and runs every night. The cron part looks like this: 00 20 * * 0,1,2,3,4,5,6 /usr/local/bin/BACKUP TBTARM HOT DELETE My issue is with the 3rd parameter. Somewhere in the script, i want to tell the script to delete some files if the 3rd... (7 Replies)
Discussion started by: dollypee
7 Replies

8. Shell Programming and Scripting

Argument passing

How to pass the alphabet character as a argument in case and in if block? ex: c=$1 if a-z ]] then echo "alphabet" case $1 in a-z) echo "the value is a alphabet" edit by bakunin: please use CODE-tags. We REALLY mean it. (9 Replies)
Discussion started by: Roozo
9 Replies

9. Shell Programming and Scripting

Passing argument not retrieving.

Hi I have a script which am trying to pass an argument which am trying to call using $1 but its not taking the value inside the if loop as it showing the error as if: Empty if.. Any help on this will be helpful. #!/usr/bin/csh echo $1 if ('$1' == "pp") then echo "Printing $1" endif (4 Replies)
Discussion started by: rogerben
4 Replies

10. UNIX for Beginners Questions & Answers

Passing a second argument

I am trying to pass a second argument like so: if ] then export ARG2=$2 else message "Second argument not specified: USAGE - $PROGRAM_NAME ARG1 ARG2" checkerror -e 2 -m "Please specify if it is a history or weekly (H or W) extract in the 2nd argument" fi however, it always goes... (4 Replies)
Discussion started by: MIA651
4 Replies
logjam(1)							    LiveJournal 							 logjam(1)

NAME
logjam - GTK+ client for LiveJournal SYNOPSIS
logjam [OPTIONS] [FILE] DESCRIPTION
logjam is a GTK+ client for LiveJournal-based sites such as livejournal.com. Aside from writing entries, logjam lets you modify your friends list, edit your previous entries, and more. When run with no arguments (or just username option), logjam will run in the GUI mode. The user interface is mostly self-explanatory, and won't be discussed here in detail, except for a few notes below. OPTIONS AND COMMANDS
Options can be given in either short or long forms. For help on a particular commands, type "logjam COMMAND help". For example, "logjam grep help" will supply help about the grep command. Options: -v, --version Show version of program. -q, --quiet Say less. -u, --username=USERNAME Username to operate as. -p, --password=PASSWORD Password for the current user. -a, --postas=USERNAME User/community to post as. -f, --file=FILE File to load. -e, --edit Use default editor to edit post. Subcommands: checkfriends Efficiently check friends list for updates. console Run a command on the LiveJournal console. post Post event immediately. offline Manage offline copies of your journal. user Manage user list. Also, GTK+ command line options (such as --display) can be used. GUI
This section describes some of the GUI features that aren't immediately apparent. Check Friends logjam can monitor your friends list and notify you when new entries are posted there. Enable this by right-clicking on the indicator at the bottom-left corner of the application window and selecting the appropriate menu item. You may also configure logjam to start doing this automatically for you when you login. When new entries are detected, the indicator will turn red to let you know; click it to resume monitoring or double-click it to open your browser on your friends page. Optionally, you can have logjam open a small "floating" indicator which has some useful GUI settings of its own. Owners of large friends lists may prefer to be notified only after they accumulate several new posts. You may set the threshold for this in the Check Friends settings tab. The default is 1, that is, logjam will tell you immediately when it detects new traffic on your friends page. There is a small limit on the maximum threshold allowed, because this feature is only useful with small threshold values. STARTUP
When given a FILE argument, logjam will start up with an existing file as the base for the composed entry. If the filename given is "-", the data will be read from standard input. Several aspects of the entry, such as its subject field and the journal in which to post it to, can be controlled by other options. This is useful in conjunction with the --commandline option, which causes logjam to post an entry without going to GUI mode, allowing completely non-interactive posts. If you do wish to interactively edit the entry, but don't want to load the GUI, use the --edit option. Autosave logjam will periodically save a draft of your currently edited entry in ~/.logjam/draft if you turn on the draft option in the Preferences dialog. This feature is intended for crash recovery, not archiving. If you want to keep a copy of your posts, you should use the Entry > Save As menu option before submitting them. A future version of logjam will support archiving of your journal. Please note that when you exit the client normally, your draft is cleared. It does not "stick" for the next invocation, as in the behavior of some other clients. Checking friends from the command line You can use logjam as a backend for a script or another application that wishes to check the friends view. This may be useful if you don't want to use the GUI, or if you have several journals (in conjunction with --username). To do this, invoke logjam once with --checkfriends=purge (-rpurge if you're using short options), and then something like: logjam --checkfriends && new-entries-handler Make sure that your script or application purges the checkfriends status as described above once the user has acknowledged the new items, otherwise logjam will always report there's nothing new. You should also pay attention to limiting your query rate, despite the fact that logjam will refuse to flood the server with queries. For more information, see the messages on the command line. (To suppress these messages, use --quiet.) SEE ALSO
<http://logjam.danga.com> <http://www.livejournal.com/users/logjam/> <http://www.livejournal.com> AUTHOR
This manual page was mostly written by Gaal Yahas <gaal@forum2.org>. 4.1.1 2003-04-25 logjam(1)
All times are GMT -4. The time now is 12:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy