|
Home > Archive > Unix administration > April 2004 > trimming a file but got error?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
trimming a file but got error?
|
|
| yls177 2004-04-28, 1:34 am |
| when i trim a file, i have this error "Invalid null command."
i can do it with root, with shell ksh. but when i am switch to other
user, i get the above error and that user shell is csh. the file
belongs to the switch user.
any ideas?
| |
| Doug Freyburger 2004-04-28, 9:34 am |
| yls177 wrote:
>
> when i trim a file, i have this error "Invalid null command."
> i can do it with root, with shell ksh. but when i am switch to other
> user, i get the above error and that user shell is csh. the file
> belongs to the switch user.
That error message is from the shell layer of the onion. Conclusion
is you have a scripting error. Some variable expands to nothing in
csh that expands to something in ksh, some ksh function being used
that isn't implemented in csh, etc. Since you don't include either
the source code for the ksh and csh commands, nor do you include
the "-x" output, it is doubtfull folks will be of further help.
Post away with that further data.
| |
| Barry Margolin 2004-04-28, 11:35 am |
| In article <c06e4d68.0404272047.4a9d8b56@posting.google.com>,
yls177@hotmail.com (yls177) wrote:
> when i trim a file, i have this error "Invalid null command."
> i can do it with root, with shell ksh. but when i am switch to other
> user, i get the above error and that user shell is csh. the file
> belongs to the switch user.
Are you trying to use the command:
> filename
That is valid syntax in shells based on Bourne shell syntax, but it's
not valid in C shell. Use:
cat /dev/null > filename
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
| |
| joe durusau 2004-04-28, 11:35 am |
|
yls177 wrote:
> when i trim a file, i have this error "Invalid null command."
> i can do it with root, with shell ksh. but when i am switch to other
> user, i get the above error and that user shell is csh. the file
> belongs to the switch user.
>
> any ideas?
The simple answer is to use whatever shell you wish. If you had posted
the
command you are using, someone could give you a better answer.
Speaking only for myself,
Joe Durusau
| |
| Bill Marcum 2004-04-28, 1:35 pm |
| On 27 Apr 2004 21:47:30 -0700, yls177
<yls177@hotmail.com> wrote:
> when i trim a file, i have this error "Invalid null command."
> i can do it with root, with shell ksh. but when i am switch to other
> user, i get the above error and that user shell is csh. the file
> belongs to the switch user.
>
> any ideas?
How are you trimming the file? If you are using "> file", that is not a
valid csh command. You could do ": > file", or as root,
"> file; chown user file".
--
Giraffe: a ruminant with a view.
| |
| yls177 2004-04-30, 11:35 am |
| Bill Marcum <bmarcum@iglou.com.urgent> wrote in message news:<tps4m1-v9q.ln1@don.localnet>...
> On 27 Apr 2004 21:47:30 -0700, yls177
> <yls177@hotmail.com> wrote:
>
> How are you trimming the file? If you are using "> file", that is not a
> valid csh command. You could do ": > file", or as root,
> "> file; chown user file".
yup.. i got the point.. thanks for replying.
|
|
|
|
|