cut - command not found


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting cut - command not found
# 1  
Old 07-11-2008
cut - command not found

Hi,

i was writing a script (in csh) and encountered this problem ...


echo - n "enter month:"
set month = $<
echo `$month | cut -c1`

the output was " Jan: Command not found"

i also tried using /usr/bin/cut instead of cut only, but same problem
i also checked my path and /usr/bin/ is present.

i also tried searching the forums, nothing came up ...

thanks!
# 2  
Old 07-11-2008
Post the output of these commands:

Code:
whereis cut
 
which cut

# 3  
Old 07-11-2008
i checked it already, it's on /usr/bin/.
# 4  
Old 07-11-2008
Problem is with the inverted commas you placed in
Code:
echo `$month | cut -c1`

Try removing them and use the below code
Code:
echo $month | cut -c1

# 5  
Old 07-11-2008
now i feel really dumb ... thanks !
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Cut command: can't make it cut fields

I'm a complete beginner in UNIX (and not a computer science student either), just undergoing a tutoring course. Trying to replicate the instructions on my own I directed output of the ls listing command (lists all files of my home directory ) to My_dir.tsv file (see the screenshot) to make use of... (9 Replies)
Discussion started by: scrutinizerix
9 Replies

2. Shell Programming and Scripting

C command not found

Dear All, I am trying to install a program in Opensuse linux and while issuing the 'make' command, its showing me an error /bin/sh: C: command not found Kindly help me to troubleshoot the problem. I have gcc, c++ all install in the linux machine. Thanks (9 Replies)
Discussion started by: biochemist
9 Replies

3. UNIX for Dummies Questions & Answers

Cut pid from ps using cut command

hay i am trying to get JUST the PID from the ps command. my command line is: ps -ef | grep "mintty" | cut -d' ' -f2 but i get an empty line. i assume that the delimiter is not just one space character, but can't figure out what should i do in order to do that. i know i can use awk or cut... (8 Replies)
Discussion started by: ran ber
8 Replies

4. Shell Programming and Scripting

Want to terminate command execution when string found in the command output

Hi Experts, I am very much new to linux scripting, I am currently working on reducing my manual work and hence writing a script to automate few task. I am running below command to snmpwalk the router.. snmpwalk -v 3 -u WANDL_SU -a MD5 -A vfipmpls -x DES -X VfIpMpLs -l authPriv... (19 Replies)
Discussion started by: Hanumant.madane
19 Replies

5. Shell Programming and Scripting

When i am trying to execute export command within a shell script it is saying command not found.

I am running the export command within a view to use that value inside my build script. But while executing it it is saying "export command not found" My code is as follows: -------------------------- #!/bin/sh user="test" DIR="/bldtmp/"$user VIEW="test.view1" echo "TMPDIR before export... (4 Replies)
Discussion started by: dchoudhury
4 Replies

6. Ubuntu

cut command not found

I am trying to sort the contents of "list.txt" based on the order matching keywords appear in "keywords.txt". I am getting this error: root@ubuntu:~/Desktop/sort# bash script.bsh cut: script.bsh: line 1: $: command not found invalid byte or field list Try `cut --help' for more information. ... (6 Replies)
Discussion started by: guitarcrazy44
6 Replies

7. Shell Programming and Scripting

bash: <command nm> command not found

I created a script that I need to run from time to time, but get this error message. To get it working again I run this command from time to time: export PATH="$PATH:~/scripts" I put all my automated scripts in the /scripts directory and would like to run my scripts from any directory... (5 Replies)
Discussion started by: catalinawinemxr
5 Replies

8. Shell Programming and Scripting

Cut Command error cut: Bad range

Hi Can anyone what I am doing wrong while using cut command. for f in *.log do logfilename=$f Log "Log file Name: $logfilename" logfile1=`basename $logfilename .log` flength=${#logfile1} Log "file length $flength" from_length=$(($flength - 15)) Log "from... (2 Replies)
Discussion started by: dgmm
2 Replies

9. Shell Programming and Scripting

how can i check in csh if command found or not found ?

hello all im trying to use in sun Solaris the information received from the top command now i several machines that dont have install the top program so when im running the script im geting error saying after im running this code : set MemoryInfo = `top | grep Memory` if (... (2 Replies)
Discussion started by: umen
2 Replies

10. UNIX for Advanced & Expert Users

command not found

Dear all, I made a FDTD code (in fortran) and i run it on the supercomputer (NEC SX-6) which is unix based. now here is the problem, if i run small program it runs without problem, but if i increase the size of the program (but exactly the same code I get the message "command not found". i was... (1 Reply)
Discussion started by: simba_tsavo
1 Replies
Login or Register to Ask a Question