Sponsored Content
Top Forums Shell Programming and Scripting Specifying a list name as argument and using that list in script. Post 302927874 by ongoto on Saturday 6th of December 2014 09:40:08 PM
Old 12-06-2014
@ sea

Could you post your output please. Your script isn't working for me?
$ check.sh list1
---------- Post updated at 06:40 PM ---------- Previous update was at 06:17 PM ----------

@ junior-helper

I didn't know about ref. Thanks

When I run your script, it uses the list1 variable list1="www.fsf.org www.defectivebydesign.org" , not the command line argument.
$ check.sh list1
If I comment out the list1 variable in your script and run it, there is no output?

Last edited by ongoto; 12-06-2014 at 10:46 PM..
This User Gave Thanks to ongoto For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

getopts and a list argument

Hi, I'm using bash and ksh93 compatible derivatives. In a recent getopts experience, I found myself spending far too much time on this little problem. I hope someone can help... So here's the deal. I want to build have a command line interface that accepts either zero, one, or... (4 Replies)
Discussion started by: duderonomy
4 Replies

2. UNIX for Dummies Questions & Answers

Argument list too long - SSH

Hi I executed the code for file in `ls pdb*.ent` do new_name=`echo $file | sed 's/^pdb//;s/.ent/.txt/'` mv $file $new_name done Its giving error at ' ls pdb*.ent' argument list too long i have around 150000 entries please help Thank you (6 Replies)
Discussion started by: empyrean
6 Replies

3. Shell Programming and Scripting

Argument too long list error

I have a wrote a script which consits of the below line.. Below of this script I'm getting this error "ksh: /usr/bin/ls: arg list too long" The line is log_file_time=`ssh -i $HOME/.ssh/id_rsa -q $i ls -lrt /bp/karthik/test/data/log/$abc*|tail -1|awk '{print $8}'` And $abc alias is as "p |... (1 Reply)
Discussion started by: 22karthikreddy
1 Replies

4. UNIX for Dummies Questions & Answers

Complete command list/argument using ps

Hi, Using ps, I can't work out what is the right options to use to show full listing of the process or command, can someone please advise what options I should be using? Example output of a "trimmed" process is as below and I know this is not the complete command line that I've executed,... (8 Replies)
Discussion started by: newbie_01
8 Replies

5. Shell Programming and Scripting

Argument list too long problem

I have a huge set of files (with extension .common) in my directory around 2 million. When I run this script on my Linux with BASH, I get /bin/awk: Argument list too long awk -F'\t' ' NR == FNR { a=NR } NR != FNR { sub(".common", "", FILENAME) print a, FILENAME, $1 } '... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

6. Shell Programming and Scripting

Argument list too long!!

Dear Experts, I have a list of 10K files in a directory. I am not able to execute any commands lile ls -lrt, awk, sed, mv, etc........ I wanna execute below command and get the output. How can I achieve it?? Pls help. root# awk -F'|' '$1 == 1' file_20120710* | wc -l /bin/awk: Argument list... (2 Replies)
Discussion started by: Naga06
2 Replies

7. Shell Programming and Scripting

mv : Argument list too long

Hi I am using find command -- find "directory1" -type f | xargs -i mv {} "directory2" to avoid above argument list too long problem. But, issue i am facing is directory1 is having subdirectories due to this i am facing directory traversal problem as i dont want to traverse subdirectories... (9 Replies)
Discussion started by: VSom007
9 Replies

8. UNIX for Advanced & Expert Users

Argument list too long w/ sed

Hi all, I am using GNU sed (named gsed under macports) in OSX. I have a directory with a series of files named pool_01.jpg through pool_78802.jpg. I am trying to use this command to rename the files to their checksum + extension. md5sum * | gsed -e 's/\(*\) \(.*\(\..*\)\)$/mv -v \2 \1\3/e' ... (3 Replies)
Discussion started by: openthomas
3 Replies

9. Shell Programming and Scripting

[Solved] Argument list with awk

Hello, I want to execute remote command with ssh. For exemple, i have a variable SERVERS=lpar1,lpar2,lpar3 I want to execute some commands like: ssh -q lpar1 ls / ssh -q lpar2 ls / ssh -q lpar3 ls / Can you help me with awk command ? Thank you :) (6 Replies)
Discussion started by: khalidou13
6 Replies

10. Shell Programming and Scripting

Argument list too long

Hi Team, Here's the situation. I have approximately 300000 to 500000 jpg files in /appl/abcd/work_dir mv /appl/abcd/work_dir /appl/abcd/process_dir The above move command will work if the jpg files count is close to 50000 (not sure). If the count is less this mv command holds good. But if... (14 Replies)
Discussion started by: kmanivan82
14 Replies
libtar_list_new(3)						  C Library Calls						libtar_list_new(3)

NAME
libtar_list_new, libtar_list_free, libtar_list_next, libtar_list_prev, libtar_list_add, libtar_list_del, libtar_list_search, lib- tar_list_dup, libtar_list_merge, libtar_list_add_str - linked list routines SYNOPSIS
#include <libtar.h> libtar_list_t *libtar_list_new(int flags, int (*cmpfunc)()); void libtar_list_free(libtar_list_t *l, void (*freefunc)()); int libtar_list_add_str(libtar_list_t *l, char *str, char *delim); int libtar_list_add(libtar_list_t *l, void *data); void libtar_list_del(libtar_list_t *l, libtar_node_t **n); int libtar_list_search(libtar_list_t *l, libtar_node_t **n, void *data, int (*matchfunc)()); int libtar_list_next(libtar_list_t *l, libtar_node_t **n); int libtar_list_prev(libtar_list_t *l, libtar_node_t **n); libtar_list_t *libtar_list_dup(libtar_list_t *l); libtar_list_t *libtar_list_merge(int (*cmpfunc)(), int flags, libtar_list_t *list1, libtar_list_t *list2); DESCRIPTION
The libtar_list_new() function creates a new list. The flags argument must be one of the following values: LIST_USERFUNC The cmpfunc argument points to a user-supplied function which determines the ordering of the list. LIST_STACK Use the list as a stack. New elements are added to the front of the list. LIST_QUEUE Use the list as a queue. New elements are added to the end of the list. The libtar_list_free() function deallocates all memory associated with the list l. If freefunc is not NULL, it is called to free memory associated with each node in the list. The libtar_list_add() function adds the element pointed to by data to the list l. The position of the new element will be determined by the flags passed to libtar_list_new() when the list was created. The libtar_list_add_str() function tokenizes the string str using the delimiter characters in the string delim. The resulting tokens are added to list l using libtar_list_add(). The libtar_list_search() function searches for an element which matches data using the matching function matchfunc. If matchfunc is NULL, a default matching function designed for ASCII strings is used. Searching begins from the node pointed to by n. The libtar_list_del() function removes the entry pointed to by n from the list pointed to by l. The libtar_list_dup() function creates a copy of the list l using dynamically allocated memory. The libtar_list_merge() function creates a new list with flags and cmpfunc, in the same way as libtar_list_new(). It then adds all ele- ments from list1 and list2 using libtar_list_add(). RETURN VALUE
The libtar_list_new(), libtar_list_dup(), and libtar_list_merge() functions return a pointer to the new list structure, or NULL on error. The libtar_list_next(), libtar_list_prev(), and libtar_list_search() functions return 1 when valid data is returned, or 0 otherwise. The libtar_list_add() and libtar_list_add_str() functions return 0 on success, or -1 on error. SEE ALSO
libtar_hash_new(3) University of Illinois Jan 2000 libtar_list_new(3)
All times are GMT -4. The time now is 10:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy