![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to get the value in last command line argument??? | amit_oddey21 | Shell Programming and Scripting | 4 | 05-28-2008 08:40 AM |
| passing a command line argument | rudoraj | Shell Programming and Scripting | 8 | 06-14-2007 12:06 AM |
| array as command line argument !!!! | spandu | UNIX for Dummies Questions & Answers | 2 | 02-21-2006 01:33 PM |
| repeating previous argument on command line? | hadarot | UNIX for Dummies Questions & Answers | 6 | 08-01-2005 03:41 AM |
| command line argument parsing | rmjoe | UNIX for Dummies Questions & Answers | 1 | 07-28-2005 04:39 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Passing the command line argument in a variable
Hi,
I am new to unix. Is their a way to pass the output of the line below to a variable var1. ls -1t | head -1. I am trying something like var1=ls -1t | head -1, but I get error. Situation is: I get file everyday through FTP in my unix box. I have to write a script that picks up first latest file that comes in and pass the content of that file to another file called the load.txt. The FTP filename changes depending on the source. I tried something like: var1=ls -1t | head -1 cat $var1>load.txt I error out on the first line of my script. Also I tried something like var1=ls -1t | head -1 | cat >load.txt. But I am not getting the desired result. I will really appreciate any help in this regards. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|