Sponsored Content
Top Forums UNIX for Dummies Questions & Answers copy *. does not work in function Post 302550611 by yazu on Friday 26th of August 2011 10:15:52 AM
Old 08-26-2011
Fileglob (things like '*.txt') is not an argument. The shell expands it to all files matching a pattern and then all these files become arguments to a command.
Look at:
Code:
sh -x -c 'echo *'

and you can see what really echo gets as arguments.
And how avoid? In your example - just use "cp". In more realistic example - call a function with necessary arguments at the front of argument list and work with optional arguments using standard shell technique - $@ array, for loop, shift builtin.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Will the continue function work ????

I have written a script which does a following functions:- 1) Check a area if it is mounted or not 2) If the area is not mounted it will prompt the user to mount the are. 3) Once the area is mounted and the option is given as Y or y the script continues... My question is will the below... (2 Replies)
Discussion started by: kamlesh_p
2 Replies

2. Web Development

work with date function

hi, how can i can pass the value of unixformat to date/time? and how can i retrieve the day/month/year from a date? thanks a lot for your help ps:i using php (1 Reply)
Discussion started by: jasonx22
1 Replies

3. Programming

why printf() function don't go work?

I use FreeBSD,and use signal,like follows: signal(SIGHUP,sig_hup); signal(SIGIO,sig_io); when I run call following code,it can run,but I find a puzzled question,it should print some information,such as printf("execute main()") will print execute main(),but in fact,printf fuction print... (2 Replies)
Discussion started by: konvalo
2 Replies

4. Shell Programming and Scripting

How to make copy work faster

I am trying to copy a folder which contains a list of C executables. It takes 2 mins for completion,where as the entire script takes only 3 more minutes for other process. Is there a way to copy the folder faster so that the performance of the script will improve? (2 Replies)
Discussion started by: prasperl
2 Replies

5. Shell Programming and Scripting

Cannot get grep to work within function.

Hello again, Am having an issue now with getting a simple grep command to work within a function.. The function is as below... function findRecord() { output=grep "001" recordDatabase echo $output } At the moment the "001"... (3 Replies)
Discussion started by: U_C_Dispatj
3 Replies

6. Shell Programming and Scripting

How the Sleep function will work?

Hi All, I am new to Unix , there i am facing one problem with sleep command. that is .. in while loop i have defined sleep function .. my condition is like this while #i knew this is infinite loop do sleep 200 echo "hello " done. this condition will never become .. true... (3 Replies)
Discussion started by: mandlysreedhar
3 Replies

7. Shell Programming and Scripting

Function doesn't work

Hello, and here's my problem: I can't get my function to do what I want. When I call my function get_from_A_to_F I give it an argument $remainder. I want my function to substitute a number higher than 9 to a specific letter. If the argument is equal to 10 than it should change it to "A".... (8 Replies)
Discussion started by: linas
8 Replies

8. Shell Programming and Scripting

Copy command does not work

I am new to this forum. I have a script which randomly throws error.Following are steps followed in this script: Generate Term file Remove previous term and rpt files from utility directory. copy term file to utility directory call sql to generate rpt file using term file as input copy the... (4 Replies)
Discussion started by: ann15
4 Replies

9. Shell Programming and Scripting

Flock preventing function to work

Hi i have a script that check pings and i use flock to so the script wont run multipul times : its not the whole script but this is the idea : ( flock -x -w 3 200 || exit 1 /usr/sbin/fping -c$count -i$interval -a $hosts > $FILE1 2>&1 ) 200>/var/lock/.myscript.exclusivelock now i... (4 Replies)
Discussion started by: batchenr
4 Replies

10. OS X (Apple)

'time' does NOT work on a function in 'dash'.

Hi guys and gals... I am writing a piece of code that is dash compliant and came across this error. I have put it in the OSX section as that is what I am using. I have no idea what the 'dash' version is but was installed about 6 months ago. MBP, OSX 10.12.6, default terminal running dash on... (4 Replies)
Discussion started by: wisecracker
4 Replies
REMINISCENCE(6) 						   REminiscence 						   REMINISCENCE(6)

NAME
reminiscence - a wrapper around rs with changed defaults SYNOPSIS
reminiscence reminiscence --datapath path reminiscence --savepath path reminiscence --levelnum num reminiscence --help DESCRITION
reminiscence is a tiny wrapper for /usr/games/rs, the REminiscence engine. It supports the same options as rs(6). The wrapper bails out if the data directory does not exist. It will also create the save game directory if needed. OPTIONS
--datapath path Use path for locating game data. Defaults to .reminiscence/data in user's home directory. reminiscence exits with an error if the directory does not exist. --savepath path Use path for game saves. Defaults to .reminiscence/save in user's home directory. The directory is created if needed. --levelnum num Start from level num. Default is 0. --help Display short usage info. SEE ALSO
rs(6) COPYRIGHT AND LICENSE
Copyright 2010, 2011 Damyan Ivanov dmn@debian.org Permission is granted to use this work, with or without modifications, provided that this notice is retained. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return. REminiscence 0.1.9 2011-03-17 REMINISCENCE(6)
All times are GMT -4. The time now is 07:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy